Consulting

Results 1 to 10 of 10

Thread: Solved: Right mouse click

  1. #1
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location

    Solved: Right mouse click

    Hello All

    I would like to add some macros to the "right click" options in word. I know this can be done, but have yet to figure it out. Thanks in advance.
    Russ

  2. #2
    VBAX Tutor cmpgeek's Avatar
    Joined
    Jun 2004
    Location
    Athens, Ga USA
    Posts
    204
    Location
    try this (and i promise nothing lol)


    [VBA]
    private sub Workbook_Open()
    Dim NewControl as CommandbarControl
    Application.OnKey "ThisWorkbook.MACRONAME"
    set NewControl = Application.commandbars("Cell").Controls.Add
    With NewControl
    .Caption = "The verbage you want to appear when you right click"
    .OnAction = "Module1.MACRONAME"
    .BeginGroup = True
    End With
    End Sub

    Private Sub Workbook_BeforeClose(Cancel as Boolean)
    On Error Resume Next
    Application.CommandBars("Cell").Controls("VERBAGE FROM .CAPTION").Delete
    End Sub
    [/VBA]

    i found this a while back on Http://www.fontstuff.com



    Life is like a jar of jalepenos... What you do with it today might burn your butt tomorrow....

  3. #3
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    I do believe island17 asked for this capability in WORD. That might change things a bit. LOL!! We'll get you there, island! Give me a few...
    ~Anne Troy

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Okay, Island. I recalled correctly, and we do have something in the KB, which you should always check first (See the KBase link at the top of every forum page to get to the kb. Log in so you can search--only VBAX members can search.)

    Here is a KB entry that tells you how to add "paste special" to the right-click menu. You can adapt it for your needs and, if you can't figure out how, just come on back to this thread and ask.

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=61
    ~Anne Troy

  5. #5
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location
    Thanks Dreamboat, I will give it a try and let you know how I make out
    Russ

  6. #6
    VBAX Tutor cmpgeek's Avatar
    Joined
    Jun 2004
    Location
    Athens, Ga USA
    Posts
    204
    Location

    i guess yesterday was just my day to be the idiot...

    sorry guys - i guess i got all excited because i thought this was one i could help with and ended up getting ahead of my self...

    i am going to go sit in the corner and handcuff myself so i can not do that again.... lol

    sorry if i confused you island - i swear i didnt mean to...

    Here's my sign...



    Life is like a jar of jalepenos... What you do with it today might burn your butt tomorrow....

  7. #7
    VBAX Tutor cmpgeek's Avatar
    Joined
    Jun 2004
    Location
    Athens, Ga USA
    Posts
    204
    Location
    in honor of the Blue Collar Comedy Tour (that i am going to see a LIVE taping of tonight)

    You might be a redneck if...
    .
    .
    .
    .
    .
    .
    you try to solve a Word issue with VBA for Excel...






    Life is like a jar of jalepenos... What you do with it today might burn your butt tomorrow....

  8. #8
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    ROFL!! Do you know how many times I've given Word answers for Excel questions? Probably...well....a gazillion! Sort of like giving VBA answers for problems that don't require VBA. And...I THINK you know what I mean... ROFL!!
    ~Anne Troy

  9. #9
    VBAX Tutor cmpgeek's Avatar
    Joined
    Jun 2004
    Location
    Athens, Ga USA
    Posts
    204
    Location
    Quote Originally Posted by Dreamboat
    ROFL!! Do you know how many times I've given Word answers for Excel questions? Probably...well....a gazillion! Sort of like giving VBA answers for problems that don't require VBA. And...I THINK you know what I mean... ROFL!!
    lol yes i think i do!



    Life is like a jar of jalepenos... What you do with it today might burn your butt tomorrow....

  10. #10
    VBAX Regular
    Joined
    Jun 2004
    Location
    New Jersey
    Posts
    52
    Location
    Thanks for all the help, but I solved the problem in a different maner. I tried the code that Dreamboat gave me, but had no luck. So I went online and found a different method. The text below is how I was able to assign a macro to the right click on the mouse.

    Thanks again

    Are you a fan of the shortcut menus that appear when you alternate mouse click? Alternate-clicking on different items provides great shortcuts to accomplishing frequently used tasks. Microsoft places frequently used commands on these menus but you can set them up to access the commands that you use the most by following these steps:

    Alternate-click on any toolbar button. Select Customize from the menu that is displayed. Select the Toolbars tab. Scroll to the bottom of the list and select the Shortcut Menus toolbar. The Shortcut Menus toolbar will appear within your workspace. Select the Commands tab. Locate a command that you want to add to a shortcut menu. When you find a command that you use often (and does not already appear when you alternate click), click and drag it onto one of three positions on the Shortcut Menus toolbar.

    The Text position contains all of the shortcut menus when you alternate click on text. If you choose to add your command to the Text position, a submenu will display and you can select which shortcut menu you need. For example, to add something to the shortcut menu that appears when you alternate click on a misspelled word, select Text and then select Spelling.

    Additions to the Table position on the Shortcut Menus make this command accessible when you alternate click on a table.

    The Drawing position makes the command accessible when you alternate click on a drawing object.

    Close the Customize dialog box and alternate click to see your result.

    Russ

Posting Permissions

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