Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Three questions:

    1) How does one assign keys(hotkey) to a macro?

    2) How does one create mouse right click menus?

    3) This questions is about tables in word. How does one via VBA code know what multiple rows have been selected. How about rows that were selected but are not next to each other. Can one know what multiple cells were selected even if the cells are on different rows and not next to each other?


    Thank you

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    1) Tools > Customize > Keyboard...

    2) Tools > Customize > Toolbars > Shortcut Menus > Drag the macro or command to the menu where you want it

    3) Selection.Information(wdEndOfRangeColumnNumber) and corresponding entries for Start of Range, Column and Row numbers

    StuartR

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Thanks Stuart. On the first two questions I assume there are VBA objects to access and perform these features?

    On question three does the selection object allow seeing that different rows, even ones not next to each are selected?

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

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Take a look (in the Word VBA help) at the KeyBindings property/collection and the KeyBinding object. A KeyBinding is a custom shortcut key assignment.

    Also take a look at the CommandBars property/collection and the CommandBar object. One of the properties of a CommandBar is Type. This can be msoBarTypeMenuBar (a menu bar), msoBarTypeNormal (a toolbar) and msoTypePopup (a context menu)

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    On question three, I don't even know how to select non-contiguous rows!!

    On your request for VBA help, I just turned on the Macro recorder and dragged the group command to the WordArt right click menu, this created the following code
    CommandBars("WordArt Context Menu").Controls.Add Type:=msoControlButton, ID:=164, Before:=2

    I'm sure you can use a similar method to identify the syntax for the controls you want to add, but be careful if your code needs to work with multiple language versions of Word.

    StuartR

  6. #6
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Select a table row, then while holding the ctrl key down move your cursor to another row and select that new row or rows

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Ah, discontiguous selection is new in Word 2002. Very limited access from VBA. See <!mskb=288424>Microsoft Knowledge Base Article 288424<!/mskb>

    Trial and error suggests that Selection.Information(...) Start and End of Row and Column return information for the first selection in the table only.

    StuartR

  8. #8
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hotkeys, right click, and Table rows (Word 2000/Sr1)

    Thanks!!

Posting Permissions

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