Difference between revisions of "Documentation/OOoAuthors User Manual/Writer Guide/Tricks for working with fields"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 20: Line 20:
 
Writer does not provide any easy way to convert field contents into text. To do this, you need to copy the field contents and paste them back as unformatted text. This is not a very good solution if you have hundreds of fields that you want to change, but you could use a macro to automate the process.
 
Writer does not provide any easy way to convert field contents into text. To do this, you need to copy the field contents and paste them back as unformatted text. This is not a very good solution if you have hundreds of fields that you want to change, but you could use a macro to automate the process.
  
A suggested macro is provided as below. (Credits: JohnV from Openoffice Forums)
+
A suggested macro is provided here: http://www.oooforum.org/forum/viewtopic.phtml?t=115398
 
 
Sub FieldsToText
 
oDoc = ThisComponent
 
oFields = oDoc.getTextFields
 
oEnum = oFields.createEnumeration
 
While oEnum.hasMoreElements
 
oNext = oEnum.nextElement
 
oNext.Anchor.String = oNext.Anchor.String
 
Wend
 
End Sub
 
 
 
 
{{Manual}}
 
{{Manual}}

Revision as of 09:20, 13 February 2011

Chapter 14: Working with Fields
< {{#switch:Previous Section Previous Section = Previous Section Next Section = Next Section Previous Page = Previous Page Next Page = Next Page }} {{#switch:Next Section Previous Section = Previous Section Next Section = Next Section Previous Page = Previous Page Next Page = Next Page }} >
[[{{{PrevPage}}}|< {{#switch:Previous Page Previous Section = Previous Section Next Section = Next Section Previous Page = Previous Page Next Page = Next Page

}} ]]

[[{{{NextPage}}}|{{#switch:Next Page Previous Section = Previous Section Next Section = Next Section Previous Page = Previous Page Next Page = Next Page

}}

>]]


Keyboard shortcuts for fields

Here are some handy keyboard shortcuts to use when working with fields:

Ctrl+F2   Open the Fields dialog box.

Ctrl+F8   Field shadings on/off.

Ctrl+F9   Show/hide field names.

F9   Update fields.

Fixing the contents of fields

You can specify Fixed content for many items on the Document and DocInformation tabs so the field contents do not update. For example, you might use a field to insert the creation date of a document, and you would not want that date to change. In another place you might use a date field to show the current date, which you do want to change; in that case, deselect Fixed content when you insert the field.

Converting fields into text

Writer does not provide any easy way to convert field contents into text. To do this, you need to copy the field contents and paste them back as unformatted text. This is not a very good solution if you have hundreds of fields that you want to change, but you could use a macro to automate the process.

A suggested macro is provided here: http://www.oooforum.org/forum/viewtopic.phtml?t=115398

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).




Personal tools