HOWTO: Trap Events Exposed by Office Applications

ID: Q238983


The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, versions 4.0, 5.0, 6.0
  • Microsoft Outlook 98
  • Microsoft Office for Windows 95, version 7.0
  • Microsoft Office 97 for Windows
  • Microsoft Office 2000 Developer


SUMMARY

You can trap events that are exposed by 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.


REFERENCES

For step-by-step examples of catching events for Microsoft Word and Excel, please click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q183599 HOWTO: Catch Microsoft Word97 Application Events Using VC++
Q186427 HOWTO: Catch Microsoft Excel 97 Application Events Using VC++

Additional query words:

Keywords : kbVC kbVC400 kbVC500 kbVC600 kbWord kbOffice2000
Version : WINDOWS:7.0,97,98; winnt:4.0,5.0,6.0; :
Platform : WINDOWS winnt
Issue type : kbhowto


Last Reviewed: October 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.