List Info

Thread: How to change the default page style




How to change the default page style
user name
2007-10-05 04:26:41
Hi,

is it possible to change the default page style, 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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: How to change the default page style
user name
2007-10-05 07:28:17
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.tex
t.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.Configurat
ionProvider")
     aPropValue.Name = "nodepath"
     aPropValue.Value = sNodePath
'"org.openoffice.Office.Linguistic"
     aArgs(0) = aPropValue
     xAccess = 
xconfig.createinstanceWithArguments("com.sun.star.confi
guration.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.Configurat
ionProvider")
     args(0).Name = "nodepath"
     args(0).Value = sNodePath
     oNode = 
aConfigProvider.createInstanceWithArguments("com.sun.st
ar.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:///&quo
t;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: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
>   

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: How to change the default page style
user name
2007-10-16 14:35:54
Hello Reinhold!

Am 05.10.2007 11:26 schrieb Reinhold Merk:
> is it possible to change the default page style, 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.

If you have not set a own default template for text, writer
uses the
size of the actual printer settings.

Change the paper format in the properties of the default
printer
(driver) of the system, so writer will open with this paper
size as
default page style.


Hope, you understand me.

Greetings
	Mathias
-- 
·-· cut here
·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·->8·-·


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )