Andreas,

Thanbks for the code below

but there is a problem

i mad a compagny template "default" so when opening a new writerdoc i have the compagny layout with the compagny styles, so far so good


then I altered your code for working with a writerdoc and there i find and empty string for the templateFileString

idem with your original code and the calc defaulttemplate

xraying your oNode object gives

ooSetupFactoryTemplateFile string    ""  read-only, may be void  <empy>


after closing OO and quiting the quickstarter the default-template settings are remembered (thy must be keeped somewhere

What am i doing wrong ?

Thanks for your patience

Fernand


Andreas Saeger wrote:
Fernand Vanrie wrote:
Andreas Saeger wrote:

yep that is what we plans to to on company-level.

Its very hard to install and maintain over 100  OO-instalations in a
countery like Belgium who uses 2-3 Languages.


Distribute commonly used templates for all 3 languages.

SO: is it posible to use the API to set a Compagny-template to "default"
as can be done as you explained with the UI

any code hints in basic would be very heplfull


I searched the name of my default template (Calc) and found this node in
<OOo_user_dir>/user/registry/data/org/openoffice/Setup.xcu

[...]
<node oor:name="Office">
[...]
  <node oor:name="Factories">
[...]
   <node oor:name="com.sun.star.sheet.SpreadsheetDocument">
[...]

    <prop oor:name="ooSetupFactoryTemplateFile" oor:type="xs:string">
     <value>$(user)/template/myDefault.ots</value>
    </prop>
   </node>

I can read the value of the property in this way, having my function
getOOoSetupValue at hand:
<BASIC>
Sub test_getOOoSetupValue()
GlobalScope.BasicLibraries.loadLibrary("OOoTools")
        sNode = 
"org.openoffice.Setup/Office/Factories/com.sun.star.sheet.SpreadsheetDocument"
        sValue = "ooSetupFactoryTemplateFile"
        print getOOoSetupValue(sNode, sValue)
End Sub

Function getOOoSetupValue(sNodePath$,sValue$)
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(sValue)
End Function
</BASIC>
AFAIK changing the default language for documents changes the char
locale of all styles in all documents created from scratch.
Thats broken now, i submit a issue

It works with my version OOo2.2 (original Sun built with Ubuntu)

This setting
will not modify any one of your templates.

AFAIK changing the default language for documents with option "this
document only" changes the char locale of all styles in the current
document. Char locales set through hard formatting still override "soft"
formatting through styles.

The above statement is halfway wrong. I should have written:
Changing the default language for documents with option "this document
only" *apparently has the same effect* as changing the char locale of
all styles in the current document.

---------------------------------------------------------------------
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]

Reply via email to