Hello,
I'm using an OleControlSite to embed Word in my application and I would like to listen for selection changes in the active document.
I tried the following code but it doesn't work.
site = new OleControlSite(frame, SWT.NONE, "Word.Document", new File(doc));
site.doVerb(OLE.OLEIVERB_SHOW);
OleListener listener = new OleListener(){
@Override
public void handleEvent(OleEvent event) {
System.out.println("event arguments length: " + event.arguments.length);
}
};
site.addEventListener(0x00000000c, listener);
According to the msdn documentation, the Application object is supposed to have an event called WindowSelectionChange but a appAutomation.getIDsOfNames(new String[] {"WindowSelectionChange"}) doesn't return any result.
And the 0x00000000c integer id comes from the Word Type Library and is supposed to correspond to the WindowSelectionChange member.
Has anyone already succeeded in listening to this event using swt ole?
FYI, I'm using Eclipse Neon and Word 2016.
Thanks
[Updated on: Thu, 23 February 2017 16:21]
Report message to a moderator