Hi all,
I'm trying to use from API the templates delivered through
extension [1], using the English version.
According to 7.1.5 [2] of dev guide the MediaDescriptor properties
TemplateName and TemplateRegionName should be the ones to be used,
but the following chunk of macro code doesn't run:
Sub Macro1
dim args(4) as new com.sun.star.beans.PropertyValue
args(0).Name = "AsTemplate"
args(0).Value = True
args(1).Name = "TemplateName"
args(1).Value = "Book"
args(2).Name = "TemplateRegionName"
args(2).Value = "Miscellaneous"
args(3).Name = "MacroExecutionMode"
args(3).Value =
com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN
oGlobalDoc =
StarDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0,
args())
End Sub
It doesn't open a new document based on the requested template.
I'd like to use the api with templates the way the
"File > New > Template and Document" dialog works, but so far
with no luck.
Any idea?
Thanks.
--
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
[EMAIL PROTECTED]
[1] http://extensions.services.openoffice.org/project/SunTemplatepack_1
[2]
http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_1_Loading_Documents
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]