Macro won't travel with document

D

Dorci

I think I must have posted this question under the wrong heading previously.
Hopefully someone can help. I’m using Word 2003, and I’ve created a macro in
my Word template using the code you posted at
http://word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm. I’ve also
added the macro to the Standard toolbar and the Tools menu. It works fine on
my computer, but I cannot seem to email it. Here’s what’s happening:

1. I double-click the template (which is not protected) to create a new
document. The custom SpellCheck button is on the Standard toolbar.
2. I add a subheading in the document.
3. I lock the document and turn off the Forms toolbar. The custom
SpellCheck button is still on the Standard toolbar.
4. I save the document with a new (.DOC) filename.
5. I reopen the document (just to peek at it). The custom SpellCheck button
is still on the Standard toolbar.
6. I email the document to a coworker. When she opens the document, the
custom SpellCheck button is gone, and the macro doesn’t even exist under
Tools > Macros.

Am I doing something wrong? Thanks in advance.
 
R

Rob

I can't be positive without seeing the doc but I'm going to guess it's
because either:
1) The doc you create from the template adds a reference to the original
template and the recipient doesn't have this template, and/or
2) You have the template in your startup folder so you always see the
toolbar and the recipient does not.
 
D

Dorci

Thanks Rob for responding. I'm guessing it's #1. There is a reference to
the template (which is stored on my hard drive) under Tools > Templates and
Add-ins > Document Template. Was I not supposed to use a template?
 
G

Graham Mayor

The macro code is stored in the template, which the other party doesn't
have. Supply the template also.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Dorci

By "supply the template" do you mean email the template as an attachment
along with the document? The recipient would then have to first save the
template before opening the document. I didn't get the impression that that
is how others are doing it.
 
G

Graham Mayor

If you want the macros to be available you either have to save them in the
document or you save them in the document template (or a global template).
Yours are in a template.

You could copy them to the document, but this has security considerations.
Unless the recipient is foolish enough to set macro security to low they
will get a macro warning message at best (which may alarm enough to cause
the user not to allow them) or the macros will be eliminated by the macro
security, which takes you back to where you are now.

If the user is expected to run the macros, you need to supply the template.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Dorci

Okay, I'll save the macro code in the document; I don't mind the security
issue. I'll let you know how that works out.

I don't mean to be a pain, but I'd really like to understand how it's
supposed to work with a template. Is that even possible? Is that not the
intent of the article on the referenced website?
 
J

Jean-Guy Marcil

Dorci was telling us:
Dorci nous racontait que :
Okay, I'll save the macro code in the document; I don't mind the
security issue. I'll let you know how that works out.

I don't mean to be a pain, but I'd really like to understand how it's
supposed to work with a template. Is that even possible? Is that
not the intent of the article on the referenced website?

Normally, template designers create a template and send that to their
clients, then the clients create their own documents from this template.

You seem to create documents that your clients need to modify... In that
case, you have to send them the template as well. It will be valid for all
documents you create from that template that you send them. You only need to
send that template once.

--

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

Dorci

THAT'S the part I wasn't getting! I didn't realize the designers were
sending the template INSTEAD of a document. Since putting the macro directly
in the document works too, I'll just as soon do that. Is there any
compelling reason I should send a template instead? The form is a survey.
The recipients will complete it only once and send it back to me. Thanks for
your responses.
 
J

Jean-Guy Marcil

Dorci was telling us:
Dorci nous racontait que :
THAT'S the part I wasn't getting! I didn't realize the designers were
sending the template INSTEAD of a document. Since putting the macro
directly in the document works too, I'll just as soon do that. Is
there any compelling reason I should send a template instead? The
form is a survey. The recipients will complete it only once and send
it back to me. Thanks for your responses.

If your documents are to be used only once, then you should be OK, except
for the security issue with the macros.

Normally, the danger is that user eventually forget to do SAVE AS instead of
SAVE and irremediably modify the original document. In your case, this does
nor seem to be an issue.

--

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

Bod

Similarly, I have a macro in one document that I want to be able to run on
another document.
I have macros set up in C:\Documents and Settings\jkemp\Application
Data\Microsoft\Word\STARTUP\Bod macros.doc
The macros in that document are always available (wish I could do the same
in Excel and PowerPoint).
1. How do I make the macros in one document available to another document
without putting the document into \STARTUP\?
2. Should "Bod macros.doc" actually be a .dot - or does that not matter:
it's just that a .dot, when saved as a .doc, sheds it's macros.
Thanks in advance.
 
G

Graham Mayor

For the macros to be available from the startup folder, the document
containing the macros must be saved as a template into that folder.
Documents in the startup folder are simply ignored.

If you want macros stored in a document (rather than its template) to be
available to another document, you must copy the macros to the other
document.

If you want macros to be universally available to your documents they should
be in the normal template or an add-in template.

If you want macros to be available to particular document types they should
be stored in the document template(s).

All Office applications have the capacity to have macros available to all
documents.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - 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