Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Intercepting right mouse click - MS Word 2000>

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian B - 28 Jan 2008 00:39 GMT
Hi All
This is probably getting outside Word, but its Word and VBA I'm working
with.

I need to intercept a right mouse click when editing a word document and
then showing a form (VB/VBA) of my own.
I have experimented with Spy++ (distributed with VB6) and while I can see
messages from other mouse clicks, I cannot see any WM_RBUTTONxxx messages
from a right mouse click.
I suspect this is because Word may be intercepting the message before Spy++
sees it.

I'm at (if not beyond!) my programming ability with this so any pointers
greatly appreciated.

Ian B
Doug Robbins - Word MVP - 29 Jan 2008 02:10 GMT
Customize the relevant right click (Short cut) menu(s) by adding a button
that calls the macro that causes the form to be displayed.

To do that, select Customize from the Tools menu and then go to the Toolbars
tab of the Customize dialog and check the "Shortcut Menus" toolbar.  Then go
to the Commands tab and from the Macros Categorym select the command (macro)
and drag it onto the expanded short cut toolbar(s)

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi All
> This is probably getting outside Word, but its Word and VBA I'm working
[quoted text clipped - 13 lines]
>
> Ian B
Ian Bayly - 29 Jan 2008 20:11 GMT
Thanks for the suggestion Doug but I must be missing something.
On my PC (Word 2003) the right click menu looks nothing like the shortcut
menu.
The shortcut menu seems to have every possible action within it, whereas the
right click menu has only 11 actions.
To rephrase the question, how can I customise the right click menu.

Ian B

> Customize the relevant right click (Short cut) menu(s) by adding a button
> that calls the macro that causes the form to be displayed.
[quoted text clipped - 21 lines]
>>
>> Ian B
Shauna Kelly - 29 Jan 2008 23:28 GMT
Hi Ian

First, some terminology. What you see when you right-click the face of a
Word document is called a Shortcut menu.

There are many shortcut menus, and which one Word displays in response
to a right-click depends on what you right-clicked. For example, if you
right click in a field, you see the Fields menu, which includes the
Update Field command. But if you right-click in a footnote, you see the
Footnotes menu, which includes commands relating to footnotes.

So you have to decide which of the many shortcut menus you want to
customize. Doug's message explained how to do that. For more details,
see:

How to assign a Word command or macro to a toolbar or menu
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Thanks for the suggestion Doug but I must be missing something.
> On my PC (Word 2003) the right click menu looks nothing like the
[quoted text clipped - 36 lines]
>>>
>>> Ian B
Ian Bayly - 30 Jan 2008 19:32 GMT
Thanks Shauna

Never knew that, I must have always right clicked on a blank portion of the
document.
Makes sense now.

Ian B
> Hi Ian
>
[quoted text clipped - 57 lines]
>>>>
>>>> Ian B
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.