Macro not working when file sent in email

K

~KO

The protected form has a spellcheck macro that runs for me fine. I send it to
another user via email - who has the same setup - and the macro does not
work. I've tried to send it as a template - no good. Also, both have macro
security set at medium.

What am I missing?

Thanks!
 
C

Charles Kenyon

If you are creating a new document based on a template (the usual way to use
a form) and then saving that as a template, it will not have your macros.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Graham Mayor

Where did you save the macro?
If you saved it in normal.dot or the document's template then mailing the
document will not carry the macro. If you saved it in the document, then the
other user's macro security will determine whether or not it can run.
Simplest method would be to copy and paste the macro code into the
accompanying e-mail message and instruct the user to copy the code into his
own normal.dot file - http://www.gmayor.com/installing_macro.htm

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
K

~KO

I saved it in the document and we both have our macro security set at medium.
It still does not run.

The form is distributed via email to mulitple locations throughout New York,
New Jersey, Pennsylvania, etc. and the users would not know how to save the
macro to their template (even if I included instructions).

So, if the macro is saved in the file and I've tried to send it as a
document and as a template and it still does not work, is there something
else I can try?
 
K

~KO

This site had an answer but I don't really understand what I'm looking at.

http://office.microsoft.com/en-us/assistance/HP051862651033.aspx

Make sure that the template used to create the form contains the macros
(macro: An action or a set of actions you can use to automate tasks. Macros
are recorded in the Visual Basic for Applications programming language.) that
users need to fill in the form. You might need to add these macros to the
template.
How?

Security Use caution when you are adding macros to your form. Macros may be
designed in such a way that their use could pose a security risk. We
recommend that you use macros from trusted sources only.

On the Tools menu, click Templates and Add-Ins.
Click Organizer, and then click the Macro Project Items tab.
To copy items to or from a different template (template: A file or files
that contain the structure and tools for shaping such elements as the style
and page layout of finished files. For example, Word templates can shape a
single document, and FrontPage templates can shape an entire Web site.) or
file, click Close File to close the active document (active document: The
document in which you're working. Text you type or graphics you insert in
Microsoft Word appear in the active document. The title bar of the active
document is highlighted.) and its attached template or to close the Normal
template (Normal template: A global template that you can use for any type of
document. You can modify this template to change the default document
formatting or content.). Then click Open File, and open the template or file
you want.
Click the items you want to copy in either list, and then click Copy.
Note You can only copy whole projects from template to template, so you may
want to create a custom project that contains only the macros you want to
copy to the new template.
 
C

Charles Kenyon

First, lets make sure the macro is in the document. Macros do not get in
documents unless someone puts them there, either manually or using code. You
can't record a macro that lets you spellcheck a form.

Open the document. Press Alt-F11 to open the vb editor. Find your document
project and the module holding the macro. If it is in your template or in
normal.dot, you won't be sending it with the document.

If you have it in your template, in a separate module (called SpellCheckForm
for example), you can use an AutoNew macro in your template and use the
OrganizerCopy method to copy the module to your new document. I haven't
tested the following but believe it will work:
Sub CopyModule()
'
' CopyModule Macro
' Macro written 3/23/2005 by Charles Kyle Kenyon
'
' Copy macro module from attached template to document.
' Can be an AutoNew macro or called from an AutoNew macro
'
Dim strModule As String
strModule = "SpellCheckForm"
Application.OrganizerCopy _
Source:=ActiveDocument.AttachedTemplate.FullName _
Destination:=ActiveDocument.FullName, _
Name:=strModule, _
Object:=wdOrganizerObjectProjectItems
End Sub

Hope this helps.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
E

Ed

Just a thought - the security settings of some email programs may
automatically "strip down" macro-containing files in the assumption that
they are viruses.

I would try writing the document to a disk or CD and taking it to another
user's machine. If it works like that, then you know something's happening
in the email process, and you need to find a different distribution method.

Ed
 
K

~KO

I have this working now. I took the macro for spellchecking a protected form
and placed it as a toolbar button on the form. Sent it via email to the user.
Great! It worked .... for her. Her user community is huge and she asked if
she could send it out. On the side of caution, I asked her to send it to one
person. Thankfully. She sent me an email stating that when the user tried to
misspell a word, it disappeared! Sorry, but when I am testing spellcheck I
would just type 'kldfjla kjf akdjfk.' This user was typing a real word wrong
(how rude!). Example, thier. What was determined is that the user had
Autocorrect/Replace text as you type checked. Now I need a macro to turn off
that function when that document is opened. I tried to record and copy but
ran into problems. Any ideas?
 
K

~KO

Ok, sorry about all these posts, but I found the answer. In my protected
fields some had the character limit set while others did not. Testing these
fields showed that the misspelled 'thier' disappeared in the fields that did
not have a character limit. I reset all fields to have a limit and it works
fine now! thanks everybody.
 

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