Confirm, From UI Insert->Fields->Author, is the created user, and respond to UNO AP Icom.sun. > > star.text.textfield.docinfo.CreateAuthor. That may cause confuse to > general user, can we add these information to API docs? > For the author fields save to MS doc format will lost issue, I will raise a bug in bugzilla.
Regards, DongJun Zong 2012/8/23 Ariel Constenla-Haile <[email protected]> > > Hi Oliver, > > On Thu, Aug 23, 2012 at 10:49:17AM +0200, Oliver Brinzing wrote: > > > > seems, there are 2 different fields: > > > > API: <text:author-name text:fixed="false">MyName</text:author-name> > > this is > file:///opt/ > openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/text/textfield/Author.html > > > > GUI: <text:initial-creator>MyName</text:initial-creator> > > this is > file:///opt/ > openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/text/textfield/docinfo/CreateAuthor.html > > > The following code: > > > Sub Main > On Error Resume Next > Dim oDoc as Object > oDoc = StarDesktop.loadComponentFromURL(_ > "private:factory/swriter", "_default", 0, Array()) > > Dim oText as Object > oText = oDoc.getText() > > Dim oCursor as Object > oCursor = oText.createTextCursorByRange(oText.getStart()) > > Dim oAuthorField as Object > oAuthorField = > oDoc.createInstance("com.sun.star.text.textfield.Author") > oAuthorField.setPropertyValue("FullName", TRUE) > oText.insertTextContent( oCursor.getEnd(), oAuthorField, false) > oText.insertControlCharacter( oCursor.getEnd(),_ > com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false ) > > oAuthorField = > oDoc.createInstance("com.sun.star.text.textfield.Author") > oAuthorField.setPropertyValue("FullName", FALSE) > oText.insertTextContent( oCursor.getEnd(), oAuthorField, false) > oText.insertControlCharacter( oCursor.getEnd(),_ > com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false ) > > Dim oInitialCreatorField as Object > oInitialCreatorField = > oDoc.createInstance("com.sun.star.text.textfield.docinfo.CreateAuthor") > oText.insertTextContent( oCursor.getEnd(), oInitialCreatorField, false) > End Sub > > > Produces 3 different fields: > > <text:p text:style-name="Standard"> > <text:author-name text:fixed="false">Ariel > Constenla-Haile</text:author-name> > </text:p> > <text:p text:style-name="Standard"> > <text:author-initials text:fixed="false">AC</text:author-initials> > </text:p> > <text:p text:style-name="Standard"> > <text:initial-creator>Ariel Constenla-Haile</text:initial-creator> > </text:p> > > > Note that optional property AuthorFormat does not exist. > > > http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/textfield/Author.html#AuthorFormat > > > Regards > -- > Ariel Constenla-Haile > La Plata, Argentina >
