EnterKeyMacro

M

MikeG0930

I have entered a macro in a word template document that makes the Enter Key
behave like a Tab Key. I got the code from Microsoft article 187985. The
article states that "for this code to work, the template should not be
protected."

However, the code doesn't work unless the form is protected but I get this
message window that says: "The context cannot be modified." Apparently, this
message is generated because the form is protected. What am I doing wrong?
 
D

Doug Robbins - Word MVP

You need to create the form as a template with the necessary formfields and
those macros in it, but leave the template unprotected. Then you use
File>New and select that template when you want to create a form so that the
autonew macro in the template will run and assign the required functionality
to the Enter Key. That macro also protects the new document for filling in
forms.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
M

MikeG0930

I thought that if you saved the document as a template, when a user opens it,
it would open as a document with the macro running?
 
D

Doug Robbins - Word MVP

MikeG0930 said:
I thought that if you saved the document as a template, when a user opens it,
it would open as a document with the macro running?
The way to use a template is to select New from the File menu and then
select the template as the basis for creating the document. If you do
that, the AutoNew macro will run.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my
services on a paid professional basis.
 

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