If this does not work, email me directly:

Sub NewDoc
 Dim oDoc
 Dim sPath$
 Dim a(0) As New com.sun.star.beans.PropertyValue
 a(0).Name = "AsTemplate"
 a(0).Value = true

 sPath$ = "file://~/Documents/DocTemplate.stw"
 oDoc = StarDesktop.LoadComponentFromUrl(sPath$, "_blank" , 0, a())
End Sub


Hmmm, you will need to specify the path to the template as a URL, so it might be something like: "file://c:/...." on a windows computer.
I have not tested this, but it is in my macro document as working.


Laurent Duperval wrote:
Hi,

I am often using the same two or three templates to create new documents. I am tired of doing it through the menus. I tried recording a macro that allowed me to open an new document based on an existing template, but it doesn't record properly.

Does anyone know of a macro that does that? Or a is there a different approach that would allow me to press a button and have a new document created, based on an existing template?

Thanks,

L



--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to