Word 2002 - macro that change selected Option back to original setting

B

blue

A while ago I found a Word macro that allowed you to change and Option
and then change back to the default option when finished or something
like that. Now that I need this Word macro I can no longer locate it.
Anyone have this macro or have the link to the macro.
thanks - blue
 
S

Stefan Blom

What did the macro do? If you explained that, maybe someone would know
which macro you are referring to. If you can't remember, it will be
difficult or impossible to tell (there are many macros around).

Try searching for the macro at the advanced group search at
www.google.com or at http://word.mvps.org.

Generally speaking, however, a macro makes use of variables to store
and then re-set properties changed during the execution of the macro.
The following is a very simple macro which changes to Outline view and
then restores the initial view (when you click OK in the message box
displayed):

Sub test()
Dim InitialView As Long
InitialView = ActiveWindow.View.Type

ActiveWindow.View.Type = wdOutlineView
MsgBox "Restoring initial view..."
ActiveWindow.View.Type = CurrentView
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

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