4specs.com    4specs.com Home Page

Tree macro Log Out | Topics | Search
Moderators | Register | Edit Profile

4specs Discussion Forum » Computers, the Internet and Networking » Tree macro « Previous Next »

Author Message
Chris Grimm, CSI, CCS, LEED-AP, MAI, RLA
Senior Member
Username: tsugaguy

Post Number: 245
Registered: 06-2005


Posted on Wednesday, April 21, 2010 - 05:03 pm:   Edit PostDelete PostPrint Post

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.
David Stutzman
Senior Member
Username: david_stutzman

Post Number: 61
Registered: 07-2002
Posted on Monday, May 10, 2010 - 07:33 pm:   Edit PostDelete PostPrint Post

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.
Phil Kabza
Senior Member
Username: phil_kabza

Post Number: 435
Registered: 12-2002


Posted on Monday, May 10, 2010 - 10:26 pm:   Edit PostDelete PostPrint Post

"It's got a good beat. You can dance to it. I'll give it a ... 10."
(Unregistered Guest)
Unregistered guest
Posted on Monday, May 10, 2010 - 08:01 pm:   Edit PostDelete PostPrint Post

I haven't created the macro, but doesn't adding and clicking the 'document map' icon to the toolbar do the same thing?
Chris Grimm, CSI, CCS, LEED-AP, MAI, RLA
Senior Member
Username: tsugaguy

Post Number: 246
Registered: 06-2005


Posted on Friday, May 14, 2010 - 02:52 pm:   Edit PostDelete PostPrint Post

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

Add Your Message Here
Post:
Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration