Word: Macro to show field shading etc.

September 1, 2010

The Word 2007 documents I’ve been working on have been written by numerous authors, both on my team and third party consultants. Although we’re all meant to use the same template, there’s no guarantee that an author can see the automated things in the template — things such as field shading, bookmark indicators, and table grid lines.

As a result, many authors inadvertently delete something they shouldn’t (such as a field or bookmark), or aren’t aware of something they should be aware of (such as a borderless table).

So I’ve created a macro that will turn on field shading, show bookmarks, and turn on table grid lines. Many thanks to Hamish Blunck who helped me with the table grid line section — as it’s a toggle switch, I couldn’t figure out how to turn it on if it’s off, yet ignore it if its already on. Hamish sorted that for me in about 1 minute flat!

I recorded the macro in Word 2007; it may also work in Word 2003 though I haven’t tested it there. Here’s the macro:

Sub ShowFieldsEtc()

' ShowFieldsEtc Macro
' Show field shading, show bookmarks, show table gridlines
   ActiveWindow.View.ShowBookmarks = True
   ActiveWindow.View.FieldShading = wdFieldShadingAlways
   If ActiveDocument.ActiveWindow.View.TableGridlines = False Then
    ActiveDocument.ActiveWindow.View.TableGridlines = True
   End If
End Sub


  1. […] written before about using a macro to show all formatting marks, bookmarks, table grid lines and field shading before, and just yesterday I gave you a macro for turning off the track formatting option in Track […]

  2. i am not able to view the TABLE TOOLS option in menu. How to enable the option

  3. ‘Table tools’ has nothing to do with this blog post. The only time you see that tab on the ribbon is if you click anywhere inside a table, or select a table — then it appears. As soon as you move outside the table, the Table Tools tab will disappear.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: