Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looping thru Word commands in VBA (2000/XP)

    Is there a way to programmatically loop through all Word commands which have been assigned a shortcut key and retrieve the keycode for the command? What I'm trying to do is intercept the "Close or Exit" shortcut (which defaults to Alt-F4); it seems that creating a FileClose sub does not intercept it. I know that it's simple enough to reassign that particular shortcut key, but I want to make sure I intercept it even if someone has assigned another shortcut key to that action.

    Thanks...

    Dan

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

    Re: Looping thru Word commands in VBA (2000/XP)

    The KeyBindings collection contains all custom keyboard shortcuts. Type keybindings into the Immediate window and press F1 for details.

    It can be difficult to trap this kind of event in Word - see the thread starting at <post#=243841>post 243841</post#>.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Looping thru Word commands in VBA (2000/XP)

    Thanks Hans. Sorry for the delay in responding--I was swept up in trying out some of the methods mentioned in the thread to which you referred me. The short story is that the thread was incredibly useful and I'm now able to do what I was trying to do. Once again, thanks a lot....

    Dan

Posting Permissions

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