Hi Sevastian,
Sevastian `seva` Foglia wrote:
In Writer, I want to set the default template.
For this, you have to do : File -> Templates -> Organize, choose a
template and right click on it and select "Set As Default Template".
I would like to do that in a macro. Is it possible ?
The following macro could helpful, unfortunately to let the changes work
the office must be restarted after the macro execution.
===================================
Sub Main
oConfProv = CreateUnoService(
"com.sun.star.configuration.ConfigurationProvider" )
dim aArgs(0)
aProp = CreateUnoStruct( "com.sun.star.beans.NamedValue" )
aProp.Name = "nodepath"
aProp.Value =
"org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument"
aArgs(0) = aProp
oConfUpdate = oConfProv.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", aArgs() )
oConfUpdate.replaceByName( "ooSetupFactoryTemplateFile",
"file:///home/mv76033/Documents/testTemplate.ott" )
oConfUpdate.commitChanges()
End Sub
===================================
Best regards,
Mikhail.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]