Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to listen to WindowSelectionChange event in Word using OleControlSite?
icon5.gif  How to listen to WindowSelectionChange event in Word using OleControlSite? [message #1754894] Thu, 23 February 2017 16:17
Gary Long is currently offline Gary LongFriend
Messages: 15
Registered: August 2012
Junior Member
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 Smile

[Updated on: Thu, 23 February 2017 16:21]

Report message to a moderator

Previous Topic:Unexpected page traversal behaviour from SWT Browser
Next Topic:Getting the "ClientArea" of an ExpandItem, i.e. knowing the trimmings
Goto Forum:
  


Current Time: Fri Apr 26 00:20:02 GMT 2024

Powered by FUDForum. Page generated in 0.03231 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top