> 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", 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: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org