How to add items to Right Click menu

S

shanep

Hi,

Can anybody point me to information that will help work out how to add
additional items to the right click men that appears?

I have the rightclick event being catpured abd can display my own tool bar I
created, but then the default right click word menu still appears after the
commandbar has been dismissed.

What I'd like to do is add my menu items to the default right click menu
that appears. I cannot find any information on how to do this so if anyboyd
knows your assistance is greatly appreciated.

regards

Shane Parkinson
 
J

Joost Verdaasdonk

-----Original Message-----
Hi,

Can anybody point me to information that will help work out how to add
additional items to the right click men that appears?

I have the rightclick event being catpured abd can display my own tool bar I
created, but then the default right click word menu still appears after the
commandbar has been dismissed.

What I'd like to do is add my menu items to the default right click menu
that appears. I cannot find any information on how to do this so if anyboyd
knows your assistance is greatly appreciated.

regards

Shane Parkinson
Hi Shane, :D

This should do the TRICK!

Double click on ThisDocument (Classmodule) and put in
this code:

Private Sub Document_Close()
On Error Resume Next

CustomizationContext = NormalTemplate
Application.CommandBars("Text").Controls("Name of
you're button").Delete
End Sub

Private Sub Document_Open()
Dim oCtl As CommandBarControl

CustomizationContext = NormalTemplate

Set oCtl = Application.CommandBars("Text").Controls.Add

With oCtl
.Caption = "Name of you're button"
.OnAction = "MacroYouWantToCall"
.BeginGroup = True
End With

Set oCtl = Nothing
End Sub

Have Fun,
Joost Verdaasdonk
 
J

Jay Freedman

Hi Shane,

You can do this without code, unless the target of the menu command
isn't always the same.

In the template that holds your macros and other customizations, add
the menu items to the right-click menus (note that there are many of
them, and which one appears depends on where the user clicked).

The procedure is described here:
http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
Pay special attention to steps 2c and 4, which describe the shortcut
(right-click) menus.
 
S

shanep

Thank Joost, it worked a treat 7 thanks jay for the link, it filled in few
more gaps.

Appreciate your time

Regards
Shane Parkinson
..
 
G

Guest

Hi Shane,

You're Welcom! ;-)
-----Original Message-----
Thank Joost, it worked a treat 7 thanks jay for the link, it filled in few
more gaps.

Appreciate your time

Regards
Shane Parkinson
..
"Joost Verdaasdonk"


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top