Forum Navigation
You need to log in to create posts and topics.

Word Macro of the Week!

Posted by: paul <paul@...>

Word Macro of the Week!

If you're like me, when the evening gets long the eyes get tired and the
font seems to grow smaller.

In Word97, I have a zoom window on my toolbar, but the problem is MS
doesn't seem to acknowledge the need for just a tiny bump upwards. It's
all or nothing at all, with the next zoom level after 100% being 150%. You
can type your desired zoom level into the combo box, but that's a tedious
process.

The solution? A nifty little vba macro, tied to a keyboard shortcut, a
toolbar icon, and/or a menu listing.

The macro code is simple:

Sub zoomin()
'
' zooms view in by 5 points
' Macro created 05/14/00 by paul batche
'
Dim z As Integer
z = ActiveWindow.ActivePane.View.Zoom.Percentage
ActiveWindow.ActivePane.View.Zoom.Percentage = z + 5

End Sub

Just go Tools/Macro/Macros (or Alt-F8), type 'zoomin' into the Macro Name
box, click Create, and copy everything between the Sub and End Sub lines
above into your Visual Basic editor, between the Sub and End Sub lines it
has written for you. Go File/Save Normal, then exit the VB program.

Back in Word, to make the macro easily accessible, go Tools/Customize,
click Keyboard, find macros, find 'zoomin', and assign it to, say, Alt-z.
Ok your way out, and you're set.

Now, to zoom in a document to a comfortable viewing range, just press
Alt-z. Using that same Tools/Customize function, you also can add the
macro to a toolbar or a menu. When you do, right-click the new entry, and
you'll be able to rename it with a convenient short name.

You can also do the same thing with a zoom-out function. The code is
similar:

Sub zoomout()
'
' zooms view in by 5 points
' Macro created 05/14/00 by ....
'
Dim z As Integer
z = ActiveWindow.ActivePane.View.Zoom.Percentage
ActiveWindow.ActivePane.View.Zoom.Percentage = z - 5

End Sub

This should work in Word 2000 too.

Happy macroing!

Paul