Handle Words-Drop-event?

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

Handle Words-Drop-event?
 
Bert Stomphorst




Posts: 21
Joined: 2005-10-31
Hi,

I'm creating a Word-addin, using a Winform. From the Winform the user does a drag, and the drop is somewhere in the Word-document.
Now I want to do several custom actions when the user drops the dragged data into the Word-document (in my case: create a bookmark around the data).

Does anybody here know how I can do that?

thank you,
Bert
Posted 29 Mar, 2006 09:48:33 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bert.

You can try the WindowSelectionChange event in Word. This event is fired when the dragged data comes to the target document.
Posted 29 Mar, 2006 12:12:01 Top
Bert Stomphorst




Posts: 21
Joined: 2005-10-31
Hi Sergey,

I already tried that, but for me (in Word 2000), the event is not fired during the drag/drop.
(I tried to start the drag/drop with DragDropEffects.Copy and with DragDropEffects.All)
Posted 30 Mar, 2006 00:55:52 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bert.

I have just tried to drop-and-drop the text from one Word window to another and the WindowSelectionChange event is fired in Word 2000.
Do you use the ADXWordAppEvents component to handle Word events?
Posted 30 Mar, 2006 16:46:39 Top
Bert Stomphorst




Posts: 21
Joined: 2005-10-31
Hi Sergey,

With a drag/drop within Word, the event is fired indeed. But in my case, I've a (topmost)winform open with a treeview. From that treeview I init a drag (sending a string with it), which is dropped in the Word-document. In that case, the event is not fired.
Posted 31 Mar, 2006 08:57:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bert.

Ok. I will test it and will let you know if I find a solution for you.
Posted 31 Mar, 2006 16:03:06 Top
Bert Stomphorst




Posts: 21
Joined: 2005-10-31
Hi Sergey,

Sorry for the late response, but I've solved this by using my Form-deactivate event (including a flag to know if a drag was started). In that event I can find the activeselection in Word to handle my own actions.

Thank you for your investigation,
Bert
Posted 25 Apr, 2006 02:06:26 Top