How to find which mouse button is clicked on MS Document?

A

Ahmad Jalil Qarshi

hi!

I want to know which mouse button is clicked on MS Word document.

is it possible? if so then please help me.

Thanks

Ahmad Jalil Qarshi
 
A

Alexander Nickolov

Please don't cross-post Word questions to the ATL groups.
Thanks.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: (e-mail address removed)
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
 
A

Ahmad Jalil Qarshi

Actually i am using ATL for automation of Word. so i m posting this question
also on ATL group.

Alexander Nickolov said:
Please don't cross-post Word questions to the ATL groups.
Thanks.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: (e-mail address removed)
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Ahmad Jalil Qarshi said:
hi!

I want to know which mouse button is clicked on MS Word document.

is it possible? if so then please help me.

Thanks

Ahmad Jalil Qarshi
 
A

Alexander Nickolov

That fact is completely irrelevant though. In case you are
surprised, many people don't answer abusive messages like
yours...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: (e-mail address removed)
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Ahmad Jalil Qarshi said:
Actually i am using ATL for automation of Word. so i m posting this
question
also on ATL group.

Alexander Nickolov said:
Please don't cross-post Word questions to the ATL groups.
Thanks.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: (e-mail address removed)
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Ahmad Jalil Qarshi said:
hi!

I want to know which mouse button is clicked on MS Word document.

is it possible? if so then please help me.

Thanks

Ahmad Jalil Qarshi
 
C

Cindy M -WordMVP-

Hi Alexander,
That fact is completely irrelevant though. In case you are
surprised, many people don't answer abusive messages like
yours...
Actually, it's not irrelevant, nor is it abusive. Word/VBA
provide no way to directly determine which mouse button was
clicked in the Word environment. Ahmad would need the Windows
API, and that most certainly falls within "your" realm, not
Word's...

Cindy Meister
 
C

Cindy M -WordMVP-

Hi Ahmad,
I want to know which mouse button is clicked on MS Word document.

is it possible?
Not directly possible with the Word object model, no. Although it
ought to be using the Windows API.

The closest you could get with Word would be to use the
WindowSelectionChange and WindowBeforeRightClick events. But
there's no way to get, for example, the middle mouse button.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
A

Ahmad Jalil Qarshi

Thank you Cindy M. I will check out these Windows API. I dont need to handle
middle mouse button. i just have to know when the right mouse button is
clicked. Thanks once again for your kind reply.

Ahmad Jalil Qarshi
 
C

Cindy M -WordMVP-

Hi Ahmad,
i just have to know when the right mouse button is
clicked.
In that case, also check out the WindowBeforeRightClick
event, as it may be more appropriate to what you need to
accomplish

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
A

Ahmad Jalil Qarshi

Thanks Cindy M.
I have used WindowBeforeRightClick. It solved my problem.
Thank you once again.
 

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