AutoNew Errors when Template Protected

B

Bill

Greetings - I have created a template in MS Word 2002
which contains a dialog box that runs a macros (EnterInfo)
via an AutoNew macro. The dialog box appears when the
template is opened and a new document is created, but only
when there is no protection on the template. When
protection is added I receive the following error message -
*The ToolsMacro command is not available because the
document is a protected document.*

This is the line of code in the AutoNew macro which is
erroring -
*WordBasic.ToolsMacro Name:=*EnterInfo*, Run:=1, Show:=3*

Any advice would be greatly appreciated. Thanks in
advance, Bill
 
D

Doug Robbins - Word MVP

Hi Bill,

I think that you might have started off on the wrong foot there. See the
article "How to create a Userform" at:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
M

Mark Tangard

Bill,

Try replacing that line with: Application.Run "EnterInfo"

(BTW those are quotes around EnterInfo above. Your post
comes through here with asterisks where the quotes should
be, so I can't tell how my quotes will show up for you.)
 
B

Bill

Mark - That worked perfect. About the quotes, I thought I
had seen other posts where astericks were used instead of
quotes. I thought maybe there would be something goofy by
using quotes, but obviously it works just fine. I have
seen you reply to many posts, so was confident it'd work.
Thanks again, Bill
 

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