Microsoft KB Archive/238983

= How to trap events exposed by Office applications =

Article ID: 238983

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 2000 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft Office Word 2007
 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition
 * Microsoft Word 2000 Standard Edition
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q238983



SUMMARY
You can trap events that are exposed by Microsoft Office applications by implementing the event interface you want to catch (the "sink"), and setting up an advisory connection with the application (the "source").



MORE INFORMATION
To set up the advisory connection, you get the server's IConnectionPointContainer and call FindConnectionPoint with the IID of the event interface. This gives you an IConnectionPoint interface. Then call Advise with an instance of your event interface. The server will call back through this interface when these events occur.

