PDA

View Full Version : Solved: Right mouse click



island17
02-15-2005, 01:54 PM
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.
:help

cmpgeek
02-15-2005, 02:27 PM
try this (and i promise nothing lol)



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


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

Anne Troy
02-15-2005, 03:05 PM
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
02-15-2005, 03:07 PM
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

island17
02-15-2005, 03:35 PM
Thanks Dreamboat, I will give it a try and let you know how I make out

cmpgeek
02-16-2005, 06:46 AM
:oops:

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...

cmpgeek
02-16-2005, 06:49 AM
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...

:think:

Anne Troy
02-16-2005, 08:08 AM
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!!

cmpgeek
02-16-2005, 08:30 AM
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!

island17
02-18-2005, 03:47 PM
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.