Carl ,

With the joined code you can make the wanted "NewWritterTemplate.ott" working

Hope it helps

Fernand

Sub set_new_writerTemplate()
 GlobalScope.BasicLibraries.loadLibrary("myTools")
sNode = "org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument"
     sProperty = "ooSetupFactoryTemplateFile"
'*****OPGELET***** the file must been in the Template directory ! 'moet in een TEMPLATE-directorie staan, anders werkt het NIET*****
      sValue = "file:///t:/template/tools/New_WriterTemplate.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


As far as I understand I should be able to set the default font and font size in the main.xcd file
The only problem is that Im not sure what the format should be... :(

I tried the template way. I created a template and copied it to every machine via a script. It does not seem to get used though. I think I need to tell every installation that it should use this file as the default template. How would this be done? Also in the main.xcd file?




On 25/01/2012 14:20, Tom Davies wrote:
Hi :)
There is a folder called "templates" in the user-profile
http://wiki.documentfoundation.org/Documentation/UserProfile
but there seem to be other weird places too and i am not sure which is used and whether any of them are not used. Looking in

Tools - Options - Paths

You can see that the templates path is has a few different alternatives rather than just one but did not seem to include the path to the folder in the user-profile!

Aaaargh!!  Is it easy enough to add an extra path?
Regards from
Tom :)


--- On Wed, 25/1/12, Jay Lozier<jsloz...@gmail.com>  wrote:

From: Jay Lozier<jsloz...@gmail.com>
Subject: Re: [libreoffice-users] Changing default margins and font for a group of users
To: users@global.libreoffice.org
Date: Wednesday, 25 January, 2012, 8:06

On 01/25/2012 01:11 AM, Carl wrote:
The user data is saved on a mapped drive on the server and the user profile is on the local PC as part of the user's windows profile.
Yes all these users are using different flavours of Windows
Can you push a template out over your network? I am not sure of the exact location of the template folder, but should be similar for all the Windows machines (I use Linux). I would look for LO in the Program folder and navigate to the template folder. You could have a problem with 32 and 64 bit locations.


On 24/01/2012 16:38, Jay Lozier wrote:
On 01/24/2012 03:39 AM, Carl wrote:
Hi,

I need to change the default margins and font in Libreoffice Writer and Calc for a group of about 100 users. How can I do this without having to go and do it manually on every PC?

Regards

Carl Werner

Where is the user data stored? If on a server, create a new default template and update the appropriate file in each user folder (or alternately change the default template location). If locally, I do not have a good idea.

Also, what OS's are involved, I assume Windows.


-- Jay Lozier
jsloz...@gmail.com


-- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted





--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to