Hi Jason,
You can't put a bare line of code like that into ThisDocument or anywhere
else. It has to be inside a procedure (a subroutine or function). Exactly
which procedure to use depends on when you want it to run.
Assuming you want this line of code to run whenever you open a document
based on a particular template, you have two choices
(
http://www.word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm):
- In the ThisDocument area of the template, create a Document_Open()
procedure and put the line inside it.
- Insert a module in the template, create an AutoOpen() procedure, and put
the line inside it.
To run the same line when a new document is based on the template, also
create a Document_New() or AutoNew() procedure.
You may also get some helpful info at
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.