How to trap DocumentBeforeClose event in Word 2007 using C++ / ATL

I am writting addin using Visual Studio 2005 C++ and ATL for Word 2007.  How do I get event notifications like    DocumentBeforeClose, DocumentBeforeSave, etc.   I need to do some processing before the document is closed or saved.  
Who is Participating?
Maybe these resources will help you better.

HOW TO: Handle Word Events by Using Visual C++ .NET and MFC

Office Automation Using Visual C++

Microsoft Office Development with Visual Studio

Automation part 2

Supplementary Note: Automation and Remote Automation
Writing application event procedures

Take Control of Microsoft Word Through Events

Intercepting events like Save and Print

cdoggettAuthor Commented:
Ya, I saw those myself...  Remember I am doing C++.

I added the IApplicationEvents2 interface but the events dont seem to get fired.
cdoggettAuthor Commented:
Not trying to be a pain, however...  This is all stuff I have seen before.  Please don't send links to 'good stuff' if it doesn't address my exact problem.  I need how to implement a callback for the DocumentBeforeClose event in Visuall Studio 2005 using Word 2007.  This is important, I have it working just fine in Word 2003.  

I tried implementing the ApplicationEvents interface and it created the various Document events, but they are not being executed.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.