How To Trap Events Exposed by Office Applications (238983)



The information in this article applies to:

  • Microsoft Visual C++ 4.0
  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Professional Edition 5.0
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002
  • Microsoft Excel 2000
  • Microsoft Excel 97 for Windows
  • Microsoft Office Word 2003
  • Microsoft Word 2002
  • Microsoft Word 2000
  • Microsoft Word 97 for Windows

This article was previously published under Q238983

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 additional information, click the following article number to view the article in the Microsoft Knowledge Base:

183599 How To Catch Microsoft Word97 Application Events Using VC++


Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbhowto KB238983