Enter key doesn't work

J

Jeff S

Hello All,

I am unsure if this is the correct newsgroup for this question so I have
cross-posted to vba.general and to application.errors. My apologies if that
is inappropriate.

I created a template in Word 2003 and when I type in the document, the Enter
key doesn't do anything. At all.

* I am using Word 2003 on a WinXP Pro SP2 system w/ 2 GB RAM.
* I have not assigned any macros, AutoText, styles, or anything to the
Enter key and I am not using KeyBinding in my VBA code.
* I am intercepting some Word commands but I can't believe they have
anything to do with it. I am intercepting:
- FileSave
- FileSaveAs
- DecreaseIndent
- IncreaseIndent
- NextCell
- PrevCell
* I did use KeyBinding in a previous incarnation of the template before I
remembered I could trap the ...Indent and ...Cell commands. That keybinding
did play with the Enter key. But after I removed the Keybinding code, I took
another precaution and started a new document and imported the "Word Command"
code module, which was wholly separate from the "KeyBinding" module.
* The Enter key works as expected in other documents.

Does anyone have an idea of what might be wrong? This is really perplexing
me and I am frustrated beyond measure. Any insight is most appreciated.

Thanks,
- Jeff
 
K

Klaus Linke

Hi Jeff,

Perhaps some KeyBinding for the Enter key still exists from your
experiments?

Dim aKey As KeyBinding
CustomizationContext = NormalTemplate
' or if you played around elsewhere, try other locations, say...
' CustomizationContext = ActiveDocument
' CustomizationContext = ActiveDocument.AttachedTemplate
For Each aKey In KeyBindings
If aKey.KeyCode = wdKeyReturn Then
MsgBox "Probably found the culprit!"
aKey.Clear
End If
Next aKey

Regards,
Klaus
 
J

Jeff S

You were quite right, Klaus. I thought I had removed the KeyBinding but it
was still there.

Thanks for your help!
-jeff
 

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