Tree macro

For those of you who like macros:

Sub Tree()
'map to keystroke Alt+T
ActiveWindow.DocumentMap = Not ActiveWindow.DocumentMap
ActiveWindow.View.ShowHeading 2
End Sub

Per line of code, I think this is the handiest spec-related macro I’ve written. It helps you quickly navigate through long documents using Word’s document map. It should work with about any document that uses outline numbering. The ShowHeading 2 option seems to works well with MasterSpec documents, and can be adjusted to your preference - maybe to 3 if you like a bit more detail.

After saving the macro in your normal.dot (if you don’t know how yet, Alt+F8 → Create will get you started), you can map to a keystroke (I use Alt+T). Go to Tools, Customize, click Keyboard button, scroll way down in left pane and click on Macros, scroll to and click on your new macro in right pane, click in “Press new shortcut key” box, type Alt+T, click Asign, Close, Close.

Now hitting Alt+T will toggle the tree on or off.

Disclaimer: If your computer blows up, or you suffer emotional harm, neither I nor my employer had anything to do with do it!

By the way (Tim, I don’t dare abbreviate!), have used on Word 2000 - 2003. Not anticipating any problems in 2007, just haven’t tested it.

Sweet. I love this. Thank you. Now a single key stroke instead of multiple clicks.

I had been searching for the right code to do exactly this but was unable to find it.

I haven’t created the macro, but doesn’t adding and clicking the ‘document map’ icon to the toolbar do the same thing?

“It’s got a good beat. You can dance to it. I’ll give it a … 10.”

this approach goes a couple steps further. it shrinks the tree to a useful size, and it maps to a keystroke.