Link to home
Start Free TrialLog in
Avatar of Mohonk
MohonkFlag for United States of America

asked on

Insert simple macro into word document.

Is there a way to insert a simple macro into a word document so it can then be run by any user who opens the document? I figured out how to modify the normal.dot file to contain the macro but not how to make it easily redistributable.

This is the macro. I basically want to be able to run spell check on a protected document.

Sub SpellCheckForm()
'
' AcceptAllChanges Macro
' Macro created 3/15/2006 by bron
'Sub SCForm()
   ActiveDocument.Unprotect
   Selection.WholeStory
   Selection.LanguageID = wdEnglishUS
   ActiveDocument.CheckSpelling
   ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

You can put it in a code module in the document. You don't have to add one - the ThisDocument module is already  there in the Microsoft Word Objects 'folder'.
Avatar of Mohonk

ASKER

Im sorry im a macro novice. Can you please explain how to do this or send me to a tutorial?
Thanks for the quick response!
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mohonk

ASKER

Awesome. It works great. Thanks for the help!
Thank you. If I can get to be 'awesome' at my (advanced) age, that's as good as the 'A' grade