Need Advice on Auto Macros in Forms

C

Cathy D.

I'm using word 2002 and Windows 2000. I've created several HR forms a
templates in Word. I used AutoNew, AutoOpen, and AutoClose macros.
The AutoNew and AutoOpen macros clean up the forms when the user enter
by shutting off the gridlines (the form is a table behind the scenes)
bookmarks, hidden characters, and so on. Then, the AutoClose macr
turns these things back on, so when users go to create tables in othe
documents they will see their gridlines again and when they use some o
our other templates, they will be able to see their bookmarks, etc.

As long as we used these forms on our network or on laptop hard drives
everything was okay. But now our IT department wants to store thes
forms on the intranet instead. To do this, they can't be put out ther
as .dot files, instead they need to be .doc files, so when the user
save them to the network/hard drive, they save as documents and no
templates. The minute you save a template as a document, the Aut
macros will not work. They only work in templates.

So, I figured I would create a regular macro that shuts all of the sam
characters off and gridlines and have it fire on the first field of th
form. This works fine and cleans up the document when it opens, th
user doesn't even see what's going on it works so well. But th
problem is, I have no way to turn gridlines and hidden characters an
bookmarks back on when the person saves/closes the file. This is
problem because the users here won't understand what's going on if the
can't see their gridlines, etc. Plus, a couple of our templates us
bookmarked areas for people to fill things in, so I need the bookmark
to show again.

Any advice you can give me to deal with this problem would be very muc
appreciated. Thanks!
 
H

Harold

You can use Auto macros in Documents, but a better choice is to use the
events in the ThisDocument object.
Either AutoOpen or AutoClose will work with a document or you can use the
Private Sub Document_Close() and Private Sub Document_Open ().

The AutoNew or Private Sub Document_New() will only fire when a new document
is created based on that document.
If you are creating new documents from documents then these will work. I
would guess that since the documents are being stored on a network share
that users are opening existing documents which would mean the AutoNew or
Private Sub Document_New() would not be appropriate.

Another option would be to create a template Addin or ComAddin that would be
installed on each user's computer. The Addin would setup an "event listener"
when Word is started. You can use these events to reset the options when
users close their documents.

Take a look at:
http://msdn.microsoft.com/library/d...n-us/modcore/html/deovrbasicclassconcepts.asp
and
http://msdn.microsoft.com/library/d...e/html/deovrCreatingEventsEventProcedures.asp
 

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