Hello,

this is kind of a follow up to my question in 2003
(http://www.openoffice.org/servlets/ReadMsg?list=users&msgNo=17481).

I would like to add a button to the toolbar, which upon clicking creates
a new document based on a certain template.

Unfortunally, the macro recoder does not work and I couldn't find the
right macros to write this macro myself.

With OpenOffice 1.x the following macro (see link above) worked:

Sub CallTemplate
  dim oTemplate as object
  dim sTemplatePath as string
  dim mNoArgs()
  sTemplatePath="file:///C:/WINNT/Profiles/des.DOUGAN.000/Application
Data/OpenOffice.org/user/template/VCC/Memo.stw"
  oTemplate = StarDesktop.LoadComponentFromURL(sTemplatePath, "_blank",
0, mNoArgs())
End sub

But if I use this macro with OpenOffice 2.0.x, printing does not work
and the filename (according to the window caption) is "" rather than
"Untitled<n>". (Workaround: Click on the edit button twice - brings up
"readonly - create copy"; that copy I can now print.)

Any ideas how a properly working macro looks like?

Tobias

PS: The missing macro recorder is issue 66183 (OOo later), that the old
marco doesn't work is issue 66184 (unconfirmed).

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

Reply via email to