Re: copy an existing style

2015-01-03 Thread Jörg Schmidt
> From: LireCouleur [mailto:lirecoul...@arkaline.fr] > Sent: Sunday, January 04, 2015 8:29 AM > To: api@openoffice.apache.org > Subject: Re: copy an existing style > > Hi Jörg. This is probably not exactly your question but if > you want to > copy styles from one document to another one, the f

Re: copy an existing style

2015-01-03 Thread LireCouleur
Hi Jörg. This is probably not exactly your question but if you want to copy styles from one document to another one, the function "loadStylesFromURL" is very useful. Sorry, this is Python code. url = ... # your template document URL try: ppp = createUnoSt

Re: copy an existing style

2015-01-03 Thread Jörg Schmidt
> From: Oliver Brinzing [mailto:oliver.brinz...@gmx.de] > Sent: Saturday, January 03, 2015 10:00 AM > To: api@openoffice.apache.org > Subject: Re: copy an existing style > > Hi Jörg, > > or try to set the parent style: > > newStyle.ParentStyle = oldStyle.Name > oStyles.insertByName("myNewStyle"

Re: copy an existing style

2015-01-03 Thread Jörg Schmidt
> From: Oliver Brinzing [mailto:oliver.brinz...@gmx.de] > i think you have to copy all Properties from old to new style. > this should work for Pagestyles: > > > REM * BASIC * > OPTION EXPLICIT > > Sub PageStyle > [...] Thank You. The following works for me: Sub Vorlage_kopieren()

Re: copy an existing style

2015-01-03 Thread Oliver Brinzing
Hi Jörg, or try to set the parent style: newStyle.ParentStyle = oldStyle.Name oStyles.insertByName("myNewStyle", newStyle) so newStyle inherits all properties from oldStyle Regards Oliver - To unsubscribe, e-mail: api-unsubsc

Re: copy an existing style

2015-01-03 Thread Oliver Brinzing
Hi Jörg, the_style = ThisComponent.getStyleFamilies.getByName("ParagraphStyles").getByName("jms1") ThisComponent.getStyleFamilies.getByName("ParagraphStyles").insertByName("jms3", the_style)> i think you have to copy all Properties from old to new style. this should work for Pagestyles: RE