Word left click event

Add-in Express™ Support Service
That's what is more important than anything else

Word left click event
Word left click event 
Srdjan Klasnja




Posts: 12
Joined: 2014-01-10
Hi,

I'm using Add-in express 7.4 to build Word 2010 Add-in.

I need to register a listener on a left mouse click event.

So far I found that I can listen to a right and double click using Application.WindowBeforeRightClick and Application.WindowBeforeDoubleClick events.

My application need to get the index of a character where the user has left clicked, so my idea is to use a Selection on left click event. Is there a better solution?

Thanks in advance,
Srdjan
Posted 10 Jan, 2014 06:32:51 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Srdjan,

the word object model doesn't provide such an event. You need to look into consequences of clicking the document. Say, if clicking modifies the selection, see the WindowSelectionChange event. If this event doesn't occur (I remember this event doesn't occur when using the Navigation Pane), you'll need to check the current selection in the CommandbarsUpdate event; this event fires really often and ineffective code may influence the overall performance of Word.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jan, 2014 08:38:46 Top
Srdjan Klasnja




Posts: 12
Joined: 2014-01-10
Helo Andrei,

Thank you ofr this response.

Can you sugest me which key combination I should use in that case to asociate my action with that event?

Is the CTRL + left click OK?

Regards,
Srdjan
Posted 13 Jan, 2014 06:22:42 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Srdjan,

As explained, the Word object model doesn't provide such an event. You need to trace the selection as explained in my previous post.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Jan, 2014 06:43:08 Top