« I'm Still Here :) | Main | 3 Webcasts Coming Up! »
Fields have got to be the sexiest feature in Word, and somehow I've never blogged about them. Well, maybe a little bit ... But, since I've been remiss in posting to the blog for the past couple of weeks, now seems like a good time for everything you ever wanted to know about fields, but were afraid to ask :)
So, what does this self-proclaimed professional Office geek think is sexy about fields? Well, for starters, they're Word's very own contortionists... you need flexibility? Here it is. But my favorite thing? They make me feel powerful. Yes, indeed. A keystroke here, a click there, and I can do things to documents that might just amaze you...
Okay, well -- first, I'll come clean. I started a new thing today. I got up early and went to the gym before hitting the computer ... and so, I'm feeling a bit sassy :) But, I'll behave now and get down to the serious tips... I'm going to start with a few field basics, then get you into keyboard shortcuts and switches -- so stick around ...
What is a field?
A field is dynamic text. Text that, in most cases, displays a dynamic result ... such as a page number, a paragraph number, a table of contents, a linked Excel chart.
Word Fields are very similar to Excel functions, in that they contain instructions that display a result. They're also similar to functions in that you can customize most of them, create and edit most of them yourself right on screen, and if you want to get really creative ... you can nest one inside another to create your own unique field results.
Why should you care about fields?
Whether you've ever opened the Field dialog box (accessible from the Insert menu) or not, I'd bet that you've had fields in your documents at some time or another. Have you inserted a page number? Added a table of contents or index to your document? Inserted a cross-reference, a hyperlink, a caption? Pasted an Excel chart or worksheet as an Excel object that you could double-click to edit? All of these commonly-used features are fields that Word creates for you. But, here's the thing ... not only can you create most of them yourself right on screen, you can edit most of those that Word creates for you. Want to know the best part? When you need more assistance, Word's own built-in help on fields is absolutely fantastic.
Want to know how to create and edit a field directly on screen, with nothing more than a few keystrokes? Read on ...
Create a field with just a few keystrokes
Check it out:
To create a field on screen:
1 - type the field's name (it's not case sensitive) and then select it
2 - Press Ctrl+F9 (turns the text into a field), followed by F9 (updates the result). If you still see the field code instead of its result at this point, press Shift + F9 to toggle the field so that it displays the result.
For example, want to create a page number field for yourself? Type the word PAGE. Select it. Press Ctrl+F9 followed by F9, and you've got yourself a page number field!
Note: Ctrl+F9, the keystoke to turn text into a field, is a keyboard-only shortcut.
Unlink a field from its result
When would you want to do this? There might be many situations, but the most common in my experience are with Embedded and Linked objects.
If you paste an Excel chart, for example, as an Excel chart object -- you not only embed the chart, but you embed everything in the workbook that the chart came from. That means that every piece of backup data, or possibly unrelated (possibly confidential) charts or data in that workbook are also accessible to anyone who opens this Word document. That might be stressful, if not for the fact that Word stores your Embedded chart object as a field...
All you have to do to protect your privacy is turn that Excel chart object into a picture. To do this, select the chart and press Ctrl+Shift+F9.
For more information on managing linked and embedded Excel objects as fields in Word, check out my earlier post: Save Time with Temporary Links (Word and Excel)
Switches
Field 'switches' are used to represent the features you can customize about most fields. For example, page numbers have a switch that allows you to select the number format. Tables of contents have many switches, including the one that adds hyperlinks from the TOC listings to the text to which they refer...
If you know the switch you need, you can type it just as you type the field name when creating a field. You can also edit an existing field in just a few keystrokes. Here are a couple of examples:
To create the page number field as we did above, but give it lowercase roman numeral format, type:
PAGE \* roman
Then select all of that text, press Ctrl+F9, followed by F9.
Or, if you have page numbers in your document and want to edit the format without opening the Page Number Format dialog box, just toggle the field (Shift + F9), type \* roman, then press F9 to update and toggle the field back to display the new result.
Want to remove the hyperlink from your TOC?
1 - Just toggle the TOC field code
(Tip: press Alt+F9 instead of Shift+F9 to toggle a TOC field code, because Alt+F9 toggles all fields in the document at once. That's a better way to go because a TOC that contains hyperlinks has the hyperlink fields within it. So, depending on where your insertion point is, Shift+F9 may or may not toggle the correct field code).
2 - delete the \h you see in that code
3 - press F9 to update
4 - press Alt+F9 to toggle all fields back to their results.
Tip: I find the ability to edit field codes right on screen particularly handy for Index And Tables entry fields (like TC entries or XE (index) entries). You never have to go back and re-mark to change what's marked or its format and other options. Just take a minute to get familiar with the the way those fields are constructed and their switches ... and you can save a ton of time.
(Also, if you use Cross References ... there are some formatting switches you can add to those references you insert through the Cross Reference dialog box, that aren't available from the dialog box -- check out the list of available REF field switches the next time you use the cross reference feature!)
Okay, what if you don't know the field name, don't know what switches are available, or don't know if there is a field to do what you need?
That's where the Field dialog box comes in. Just click Field on the Insert menu to open this dialog box. Here, you can scroll through a listing of every built-in field's name -- categorized or alphabetically. The dialog box will show a description of the selected field on the bottom left as you scroll.
While this dialog box gives you the ability to set up and customize your fields right there (and that's fine, if you prefer it) ... you can also click Field Codes at the bottom of the screen, and then Options -- to open the Field Options dialog box. There, you will see a listing of all available switches for the selected field, along with descriptions. If Options wasn't available when you clicked Field Codes, there are no switches for the selected field.
Want more detailed help than this dialog box provides? Search any field name in Word's help, and in almost every case you will get detailed explanations of what the field does, what switches are avaialble and how to use them. This help coverage is just as good as Excel function help... which has gotten me through many a project ...
This post is quite long, and I have to get working :) so I'm not going to go into nested fields right now. But, if you have a specific question on anything related to fields ... post a comment, and I'll respond as quickly as I can.
Happy Monday Everyone!!
Posted by Stephanie
TrackBack URL for this entry:
http://www.arouet.net/cgi-bin/mt/mt-tb.cgi/60
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)
Comments
Yeah, fields are pretty handy, and so are bookmarks. That's how my VBA code knows where to insert Excel content into a Word template.
I use fields in a funny workaround too. I haven't figured out how to determine what page a range is on when using VBA. What I do instead is to insert a page field, read its result (the page number), then delete the field.
Is there a better way, or have I stumbled upon yet another obscure Word best practice?
- Jon
Posted by: Jon Peltier | April 12, 2005 07:36 AM
Hi, Jon! Thanks for posting ...
Funky workaround :) but there is a better way ... the Information property (either with the Selection object or the Range object - depending on what you're locating) will do that with the 'wdActiveEndPageNumber' constant. That returns the page number at the end point of your active selection.
If you want the page number assigned to the page instead (i.e., as it's set in page number format), use the constant 'wdActiveEndAdjustedPageNumber.'
I know you're familiar with the Information property ... have you encountered a siutation where this won't do the job?
Steph
Posted by: Stephanie Krieger | April 12, 2005 09:37 AM
Hi Steph -
Thanks for clearing up that mystery. I couldn't believe there was no such property in Word.
Now that you mention it, I do vaguely remember the Information property. I'm sure this will speed up the macro, in addition to being less funky.
I did search in the help for "page", but this entry must have been lost among all the critical information on mage number formatting.
- Jon
Posted by: Jon Peltier | April 13, 2005 07:06 PM
Is there an easy way to globally search and replace text with hyperlinks to a bookmark (I have a 348 page doc. with MANY references I want to link; eventually to be converted to eReader for use on a PDA)? One I have created manually, using 'Insert Hyperlink' to 'Place in this Document' is: { HYPERLINK \l "Matthew" } which takes me from a cite of "Matt. 1:1" in the text to the Bookmark "Matthew".
Posted by: Alice | July 20, 2005 02:18 PM
Hi, Alice,
Sounds like a macro is going to be what you need.
Do you edit macros in VBA yet?
First thing to figure out if you can easily write a macro for this ... are there consistencies between the naming of the text you want to hyperlink and the naming of the bookmark it should link to? You'll need a definable consistency to do this globally by any method.
One thing ... can I ask that you continue this thread on the current posting on my main page so that others can better benefit from the answer? ... since this is an older post, less people are likely to see it and I think it's an interesting question you have.
Best,
Stephanie
Posted by: Stephanie | July 20, 2005 02:29 PM