Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    KeyPress and KeyDown Events for a Document (Word 97 and >)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    Here is what I need to do:

    I have a document that needs to be 1970 characters in total. Spaces and all must be less than 1971.

    I want to count the characters dynamically so that when the user has typed 1960 characters, I start flashing messages, so that the user knows the count and then will stop typing.

    This also can be used to not allow the user to type the 1971st character.

    This document is going to be saved in a folder and read by a main frame application written before 1970, so there is no way I can finagle myself out of this one <img src=/S/hushmouth.gif border=0 alt=hushmouth width=16 height=16>. I may retire and the application is still going to be there <img src=/S/sad.gif border=0 alt=sad width=15 height=15> <img src=/S/drop.gif border=0 alt=drop width=23 height=23>

    What do you suggest?

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: KeyPress and KeyDown Events for a Document (Wo

    I think someone posted some code once, probably on the VBA board, that updated a character count in the Status Bar. I think Chris Greaves was involved in that thread (sorry, that doesn't really help narrow it down much).

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: KeyPress and KeyDown Events for a Document (Word 97 and >)

    The thread Jefferson referred to starts at <post#=114258>post 114258</post#>.

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: KeyPress and KeyDown Events for a Document (Word 97 and >)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Hans

    This thread was very helpful. I read it very intently, but the draw backs are deadlier than the benefits.

    I mean the KeyBindings with the space bar locked up MS-Word and I had to delete the Normal.DOT to get the space bar functioning again.

    I tried both the CustomizationContext = ActiveDocument FindKey(BuildKeyCode(wdKeyTab)).Disable and the .Clear option, with the space key, and it did not release it. I literally had to remove the Normal.DOT and reboot and then all was OK.

    How does one release the key binding without destroying the Normal.DOT?

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: KeyPress and KeyDown Events for a Document (Word 97 and >)

    If you select Start | Run... in Windows, type winword /a and press Enter, Word will start without loading Normal.dot. You should then be able to release key bindings.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: KeyPress and KeyDown Events for a Document (Word 97 and >)

    Since you have continued the discussion in <post#=395013>post 395013</post#>, I will lock this thread to avoid confusion and duplication.

Posting Permissions

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