Zooming the document map, Word 2007

P

PeterH

In Word 2007, I can zoom the document map by pressing SHIFT-F6 and then using
the zoom bar at the bottom of the Word window.

However, the macro recorder will not record this action.
How can the action be done programmatically, i.e. in VBA ?
 
G

Graham Mayor

The zoom setting is the same as the zoom setting used for the Word document,
however you can set it and the document map width by intercepting the
command to open the document map eg

Sub ViewDocumentMap()
Dim sZoom As Integer
sZoom = ActiveWindow.View.Zoom.Percentage
With ActiveWindow
If .DocumentMap = False Then
.DocumentMap = True
.DocumentMapPercentWidth = 25
.View.Zoom = 150
Else
.View.Zoom = sZoom
.DocumentMap = False
End If
End With
End Sub

The above will open the document map with a zoom of 150% and a width of
25% - change the figures to what you want them to be.

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

PeterH

Thanks Graham. The macro works only halfways. It does turn on the document
map with the specified width, but then it zooms the main window, not the
document map. So it does not work at intended. As said before, the document
map is easily zoomed manually. So it's strange that it should be so difficult
to do programmatically. Best wishes, Peter.
 

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