Macro doesn't work after save

D

DualStar

I am using Word 2007. I have a word template with several macros and
when I open it as a template the macros work fine. When a user opens
the template as an instance the first time, the buttons work. One of
the macros is a command button to save the form as a macro enabled
document (.dotm) in the users My Documents folder.

The save works, but when the user opens the form from his My Documents
folder and tries to use any of the buttons, nothing happens. When I
check the VB Editor the template is visible but the form is referenced
to the Normal template.

Is there any way that I can have the document save with the macro code
attached to the document itself so users can reopen and edit them?

Thanks in advance for any assistance.
 
D

Doug Robbins - Word MVP

Is the user actually opening the template (using File>Open) or using
File>New and then selecting the template? If the documents created by the
second method are then being re-opened on the machine on which they are
created, the document can merely be saved as a docx, as when it is
re-opened, there will be a reference created to the template from which it
was originally created and the macros in that template will be available for
use.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

DualStar

Thanks for the reply.

The templates are copied from the server down to company computers (C
drive) at log on. The user opens them from New Office Documents or
through File > New > My Templates. When the user is done filling out
the form he will click the Save button which will save to their My
Documents folder.

On several of the forms there is also an email button that will auto-
email to the appropriate people. When these people get the form in
their emails they may wish to use the buttons on the form, but cannot.
When the original user goes into his My Documents folder, opens the
form and tries to use any of the macros, he cannot.

I have looked at the editor and the template for the form is listed in
the project window, but the form, which is also listed there, is now
referencing the Normal template.

Am I missing something?
 
D

Doug Robbins - Word MVP

Are you sure that the template is on the machine when the document in being
opened?

When I open a document that is created from a template, and then look in the
Project Window of the Visual Basic Editor, there is an item ThisDocument and
a Reference to [Template Name] in that order.

If I open the document on another machine on which the template is not
present, then the Project Window of the Visual Basic Editor shows a
Reference to Normal and an item ThisDocument in that order.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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