Selection Change

M

Mike Petrie

I'd like to be able to detect when the user has moused a selection so I can
use bookmarks to log the start and end of the selection. Is there a way to
do this? Ideally it would need to work in Word 97 onwards.


Thanks
Mike
 
J

Jezebel

You can trap the WindowSelectionChange event. This certainly picks up
'moused' selections. Not sure if it works with Word 97; definitely from 2000
onwards. It doesn't pick up some keyboard-driven selection changes.
 
P

Peter Hewett

Hi Mike Petrie

It's an application event and unfortunately not supported in Word 97 :(

Cheers - Peter


You can trap the WindowSelectionChange event. This certainly picks up
'moused' selections. Not sure if it works with Word 97; definitely from 2000
onwards. It doesn't pick up some keyboard-driven selection changes.

HTH + Cheers - Peter
 
M

Mike Petrie

Thanks all,

I'll dig into how to do this some more now I know where to look. With it not
being available in Word 97 would I need to find a way to make Word 97 bypass
this or would I need to create two seperate add-ins to stop Word 97
complaining?

Thanks again.
Mike
 
J

Jezebel

My recollection of this is that the events are simply not fired in Word 97,
so your add-in just won't function. It won't MALfunction, just silently do
nothing. But don't take my word for it....You always have to test.
 
P

Peter Hewett

Hi Mike Petrie

If you use code such as:

Private WithEvents appWord As Word.Application

Private Sub appWord_WindowSelectionChange(ByVal Sel As Selection)
' Do something!
End Sub

This will work with later version of Word but Word 97 will just ignore the procedure
"appWord_WindowSelectionChange" as it will not recognise the "WindowSelectionChange"
event. But I don't see that this helps you.

Cheers - Peter


Thanks all,

I'll dig into how to do this some more now I know where to look. With it not
being available in Word 97 would I need to find a way to make Word 97 bypass
this or would I need to create two seperate add-ins to stop Word 97
complaining?

Thanks again.
Mike

HTH + Cheers - Peter
 

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