Enter key mapping

M

Mark Kaynor

I create a new template, insert the code KB Article
187985 - "how to code the enter key to move to next field
in protected form"
(http://support.microsoft.com/default.aspx?scid=KB;en-
us;q187985). This is the only code in my test template. I
then inserted a few form fields, and it all seems to work
correctly and I can exit w/o error.

I then create a new section for "free form" text that
isn't protected - protect the template selecting Forms /
Sections, and select section 1 where the form fields are.
I then unprotect and save the template.

When I create a new document, the enter key moves between
the fields as expected, and I can move the cursor to the
unprotected section and type in text.

When I close Word a runtime error 5852 - Requested Object
Is Not Available.

Any thoughts as to why this would be occurring? Thanks.

Mark Kaynor
 
M

Mark Kaynor

Forgot to mention - Word 2000 on Win2K. I just did some
more testing. When I close the document, it all seems to
be working fine. The error occurs when I close Word.

The error occurs on a new test template w/o no sections -
just 3 form fields and the VBA module created from the KB
article mentioned below.

Any suggestions greatly appreciated.
 
D

Doug Robbins - Word MVP

Hi Mark,

If you click on debug, what line of code is highlighted?

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 Kaynor

Doug,

The Debug button is greyed out. I've tried setting
breakpoints and stepping through to the error, but it
occurs after the document is closed, as Word itself is
closing.

Mark
 
M

Mark Kaynor

Doug,

Some more info - when I remark out the line

"CustomizationContext = ActiveDocument.AttachedTemplate"

in each of the three auto macros the error doesn't occur.
Of course, the key remapping no longer works, too, but at
least the error goes away.

Mark
 
W

Word Heretic

G'day "Mark Kaynor" <[email protected]>,

need to see your doc close code.



Mark Kaynor said:
Forgot to mention - Word 2000 on Win2K. I just did some
more testing. When I close the document, it all seems to
be working fine. The error occurs when I close Word.

The error occurs on a new test template w/o no sections -
just 3 form fields and the VBA module created from the KB
article mentioned below.

Any suggestions greatly appreciated.

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

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