setting default show levels

C

Chris

I am trying to set Word 2003 to set a show level of 2 in an outline when I
open it. Currently when I close my Word Doc and re-open it, it automatically
shows all levels. I am researched this issue and have come up with no
resolution. I heard a rumor that I can edit one of the existing Macros within
word to show only level 2 but I do not know how to do thaty either.
 
G

Graham Mayor

There are no 'existing macros' in Word unless you have created them. You can
intercept built-in functions by naming macros the same as their function
name and add extra commands as required eg. To switch to Outline View and
set level 2 you could intercept the built in comand to select outline view
as follows:

Sub ViewOutlineMaster()
With ActiveWindow.View
.ShowHeading 2
.Type = wdMasterView
End With
End Sub

Save the macro in the document (though this has security implications) or in
the document's template (which will have distribution implications) or in
the normal template, when it will cause all documents switched to outline
view to display level 2. Note that if there are less than two levels, it
does not cause an error.

If you wish to add a macro to a toolbar to toggle the level between 2 and
all levels (easily adapted to any level) then

Sub ToggleLevel2()
For ShowHeadinglevel = 71 To 77
If CommandBars.FindControl(ID:=ShowHeadinglevel).State Then
ShowHeadinglevel = (ShowHeadinglevel - 70)
Exit For
End If
Next ShowHeadinglevel
With ActiveWindow.View
If ShowHeadinglevel = 2 Then
.ShowAllHeadings
Else
.ShowHeading 2
End If
End With
End Sub

http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

Chris

Thank you for your help. Rather than writing a new Macro, i actually just
recorded one and it seems to do the trick. Although, now I have a general
idea on how to write my own if I need it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top