Show field codes gaffe

Office for Mere Mortals helps people around the world get more from Word, Excel, PowerPoint and Outlook. Delivered once a week. free.


We take a secondary look at one reader’s field code related problem.

Okay. I blew it. What can I say?

In the last edition of Office for Mere Mortals I told you about my friend and his untimely encounter with a weird {HYPERLINK …} thingy in one of his Word documents. I told you (and him) to click the backwards-P icon on the toolbar to get rid of the weird thingy (it’s called a field code) and put Word back to showing normal stuff on the screen.

I blew it big-time. But I blew it for a good reason – and I hope to atone for my sins this week by showing you one of my favorite timesavers in Word.

Thanks to all of you who wrote, especially Suzanne Barnhill, one of my favorite Word gurus, who had the entire situation diagnosed and resolved within 30 seconds of the newsletter hitting the ether. I self-administered the requisite number of lashes and stand humbled.


WHAT I SHOULDA SAID

When you see a weird thingy in Word that starts and ends with a curly brace, like this:

{ HYPERLINK “ms-its:C:WINDOWSHelpfonts.chm::/windows_fonts_print.htmEXEC=,control.exe,%20fonts%20CHM=ntshared.chm%20FILE=alt_url_windows_component.htm ” o “” }

you’re looking at a field code. You almost never want to see the field code. You almost always want to see the results of the field code. So, for example, you almost never want to see a field code like, oh, {DATE @ “M/d/yyyy”}. You almost always want to see today’s date, 12/11/2003.

There are several ways to coerce Word into showing you field code results, instead of the codes themselves. The easiest one to remember (for me anyway) is the one I mentioned last week: click Tools | Options | View and uncheck the box marked Field Codes.

If you can remember the right key combination, you can also simply press Alt+F9. That toggles between showing field codes and showing field code results, through the whole document. Chances are good that my friend was looking at the weird {HYPERLINK blah blah } field because he accidentally hit Alt+F9.

You can also right-click on a field code and choose Toggle Field Codes, or select any number of field codes (or even select the whole document), right-click and choose Toggle Field Codes.

$$PAGE$$

WHY CLICKING BACKWARDS-P WORKS FOR ME

I have one favorite macro that I’ve been using and occasionally updating for almost a decade. I write about it in all of my Office books. It’s very handy because it kicks in when I click the backwards-P icon on the standard toolbar – an icon I never use because I hate to see all those dots between words.

If you’ll forgive a little pseudo-programming code, the macro does this:


Turns off “Show All” (which shows para marks, tabs, spaces, and more)

Turns off “ShowSpaces” (which puts those horrible dots on the screen wherever there are spaces)

If “Show Field Codes” is on for the entire document, the whole document is set to show field results (but if you have a specific field code showing, it isn’t touched)


Toggles:



  • Showing paragraph marks
  • Showing tab marks

I put this macro on every machine I use, every copy of Word that I have, except for the one virgin copy of Office 2003 that I keep for writing books.

NEW SHOWALL

Here’s how to take over the backwards-P icon on the Standard toolbar, and make it do something useful.

Click Tools | Macro | Macros. In the box marked Macro Name, type ShowAll. Click Create. Word will show you the program that it’s currently running whenever you click the ShowAll button.

Change that macro so it looks like this (you can cut ‘n paste from here, but make sure you only have one “Sub ShowAll()” line and one “End Sub” line):

Sub ShowAll()
‘ A better ShowAll – Office for Mere Mortals
https://office-watch.com/?465
‘ by Woody Leonhard, Justin Leonhard and Guy Wells
   ActiveWindow.ActivePane.View.ShowAll = False
   ActiveWindow.ActivePane.View.ShowSpaces = False
   ActiveWindow.ActivePane.View.ShowFieldCodes = False
   If ActiveWindow.ActivePane.View.ShowParagraphs Then
      ActiveWindow.ActivePane.View.ShowParagraphs = False
      ActiveWindow.ActivePane.View.ShowTabs = False
   Else
      ActiveWindow.ActivePane.View.ShowParagraphs = True
      ActiveWindow.ActivePane.View.ShowTabs = True
   End If
End Sub

The easiest way to get the macro into your machine is to copy the text from this newsletter and paste it into Visual Basic, deleting the old lines where they aren’t needed.

Test the program by clicking the ShowAll button. When you’re done, shut down Word normally. From that point on, the ShowAll button will work the way you want. If you mess something up terribly, click Tools | Macro | Macros, choose ShowAll, and click Delete. Word will go back to working the way it used to – ugly dots and all.

Thanks to Justin Leonhard and Guy Wells for help with the macro.

 


Want More?

Office Watch has the latest news and tips about Microsoft Office. Independent since 1996. Delivered once a week.