> From: Oliver Brinzing [mailto:[email protected]]
> Sent: Saturday, January 03, 2015 10:00 AM
> To: [email protected]
> Subject: Re: copy an existing style
>
> 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
that's very interesting, the following works here:
oStyles = ThisComponent.StyleFamilies.getByName("ParagraphStyles")
oldStyle =
ThisComponent.getStyleFamilies.getByName("ParagraphStyles").getByName("jms1")
newStyle =
ThisComponent.CreateInstance("com.sun.star.style.ParagraphStyle")
newStyle.ParentStyle = oldStyle.Name
oStyles.insertByName("jms2", newStyle)
But it is not so very helpful, because copying a template within a document is
only a test, my true goal is to copy a template between two documents.
Greetings,
Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]