OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Convert fields to text

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Sat Feb 12, 2011 9:05 am    Post subject: Convert fields to text Reply with quote

The ability to quickly convert Writer fields of text is occasionally ask for. I've posted this code in response to such requests but, of course, can't easily find it so I'm sticking in Code Snippets this time.
Code:
Sub FieldsToText 'Writer
Dim oDoc,oFields,oEnum,ThisField
oDoc = ThisComponent
oFields = oDoc.getTextFields
oEnum = oFields.createEnumeration
While oEnum.HasMoreElements
ThisField = oEnum.nextElement
ThisField.Anchor.String = ThisField.Anchor.String
Wend 
End Sub
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group