Need to create an autoexec macro for Word 2003 to open in Normal View

O

Osceolakid

Hello,

I've never written a word macro before. I need to create this for
Corporate Deployment where all the word users when they launch wor
will have it open in Normal View..currently its PageLayout View whic
the bosses refuse to accept and are after me to fix it.

Out on the Microsoft Word Installation newsgroup some nice person tol
me the way to fix this is to create an Autoexec macro. Unfortunatel
can't find the right syntax to use for the Macro. Can someone help m
please?

Thank You!

Glen
 
J

Jean-Guy Marcil

Hi Glenn,

Just out of curiosity, why are the bosses so against page layout view? Of
all the things a boss has to worry about in the normal course of business,
this seems to be a pretty low priority item!

Anyway,
the code you may want to use is:

ActiveWindow.View.Type = wdNormalView

But it will not solve your problem.

You have to put it in Normal.dot, in a macro called AutoNew and in an
AutoOpen macro as well. You cannot set the view with an Autoexec macro
because when AutoExec fires, there are no documents yet opened, so no Window
to set.

The problem with this is that the view is saved with the document. I may
create a document that was opened in Normal view, change it to Page layout
and save it. So next time, it will open in page layout. All you will succeed
in doing is annoy the hell out of users who want to work in page layout
view.

Anyway, your decision! Also, you do not need a macro just to set the default
view for new documents based on Normal.dot.
See
http://word.mvps.org/faqs/general/SaveViewAndZoom.htm

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

DA

Hi Glenn
VBA supports a range of standard document events which you can use as
a trigger for your code. One of these is the "Open" event, which is
just what you want.


- Start the VBA editor (Alt-F11)
- Go to "ThisDocument" in your document project > right click and
select "View Code"
- There are two drop down menus at the top of the code window. Select
the left one and pick "Document".
- Select the "Open" event from the other dropdown menu.
- Now paste the following code into the window

'----
Private Sub Document_Open()
ActiveWindow.ActivePane.View.Type = wdNormalView
End Sub
'----

Just as a tip, you can record your actions from the Tools >Macro menu.
Once you've recorded the actions you want, you can look at the code in
the VBA editor.

All the best,
Dennis
 

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