Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Nov 2001
    Burbank, Illinois, USA
    Thanked 0 Times in 0 Posts

    Using Enter to go the next table cell (Word 2000)


    I am wondering if there is any way to use the enter key to go to the next cell in a Word table. A table is being created for customers to use, and the person creating the table would like the customer to be able to press the enter key to move to the next field(cell). As of right now, when the enter key is pressed, it creates another line in the cell and the only way to get to the next cell is to use the tab key.

    Thanks for all of your help!

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: Using Enter to go the next table cell (Word 20

    There was a discussion here recently about doing this in a form, meaning a document where the table contains form fields (the kind inserted using the Forms toolbar). When you use form fields and protect the document for forms, you can create macros that dictate how the user can move through the document with quite a bit of precision. In a normal document, you can't do this.

    There is a way to assign one key to behave like another. It should in theory be possible to have this assignment take effect only in one document. If you choose Tools > Customize... > Keyboard... you will notice that there is no "easy" way to make Enter behave like Tab. This is good - most of the time.

    So, let's say you write a macro that does this:

    <UL><LI>If I'm in a table, then do Selection.MoveRight unit:=wdCell (emulate the Tab key).
    <LI>Otherwise, "type" an Enter using Selection.TypeParagraph.[/list]Now, this may create havoc in contexts where the Enter key is supposed to do other things, but just for a moment let's pretend our SpecialEnterKey macro is perfect. To assign it to the Enter key, you need to run a macro like this:

    <pre>Sub SetKeyBinding()
    CustomizationContext = "MyFormDocument.doc" 'Save ONLY in this document!!!
    KeyBindings.Add KeyCategory:=wdKeyCategoryMacro, _
    Command:="SpecialEnterKey", _
    End Sub</pre>

    (This was adapted from <!post=Post #114359,114359>Post #114359<!/post>.)

    The above key assignment can be set in the document using an AutoOpen macro and, just in case it infected any other templates, cleared in an AutoClose macro. But lots of testing should be done before unleashing such a thing, or you will get lots of user complaints.

    Hope this helps.

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Stuttgart, Baden-W, Germany
    Thanked 0 Times in 0 Posts

    Re: Using Enter to go the next table cell (Word 20

    > (This was adapted from Post #114359.)

    I copied/edited the example code from the VBA help example for KeyBinding/Add method, so I guess it's in the public domain <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    The interesting thing in the cited post probably was that you can make a lot of KeyBindings (shortcut key assignments) with VBA code that you can't make from the user interface -- such as Return or the space bar -- a fact the VBA help doesn't advertise.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts