Reinhold Merk wrote:
Hi,
is it possible to change the default page style
there is no longer a "default" page style is now build by code
so we stored somewhere a Compagny-default-document and changes the xcu
settings
the basic code find you below
hope it helps
Sub setcompagny_new_writerdocument()
' GlobalScope.BasicLibraries.loadLibrary("myTools")
sNode =
"org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument"
sProperty = "ooSetupFactoryTemplateFile"
'*****attention***** de file must be placed in a
TEMPLATE-directoriy (see the path_settings macro *****
sValue = "file:///t"somewher on you
servers"/template/tools/Compagny_new_writerdocument.ott"
setOOoSetupValue(sNode, sProperty, sValue)
End Sub
Function setOOoSetupValue(sNodePath$, sProperty$, sValue$) as boolean
on error goto exitErr
Dim bReturn as Boolean, xconfig, xAccess
dim aArgs(0) as Object
dim aPropValue as new com.sun.star.beans.PropertyValue
xconfig =
createunoservice("com.sun.star.configuration.ConfigurationProvider")
aPropValue.Name = "nodepath"
aPropValue.Value = sNodePath '"org.openoffice.Office.Linguistic"
aArgs(0) = aPropValue
xAccess =
xconfig.createinstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aArgs())
xAccess.setPropertyValue(sProperty, sValue)
xAccess.commitchanges
bReturn = True
exitErr:
setOOoSetupValue = bReturn
End Function
Function getOOoSetupValue(sNodePath$,sProperty$)
Dim aConfigProvider, oNode, args(0) As new com.sun.star.beans.PropertyValue
aConfigProvider =
createUnoService("com.sun.star.configuration.ConfigurationProvider")
args(0).Name = "nodepath"
args(0).Value = sNodePath
oNode =
aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess",
args())
getOOoSetupValue = oNode.getbyname(sProperty)
End Function
Sub paths_settings
oPathSettings = CreateUnoService( "com.sun.star.util.PathSettings" )
'xray.xray oPathsettings
oPathSettings.setPropertyValue( "Template" ,
"file:///C:/ooffice/share/template/english;file:///"somewhere on you
servers"/template")
oPathSettings.setPropertyValue( "Work" , "file:///H:")
MsgBox("Ok Paths zijn aangepast" + chr(13) + oPathSettings.work +
chr(10) + oPathSettings.Template)
End Sub
, more precisely the paper
format from A4 to another value (in that way that OO starts every time with
this value and the user needs not to change it manually)? I've searched in
the .xcu-files for such a property value, but unfortunately without success.
Thank in advance!
Reinhold
---------------------------------------------------------------------
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]