Solved

Catching Events in a Automated MS Word Application

Posted on 2006-07-07
5
361 Views
Last Modified: 2013-11-20
Hello,
         I am trying to automate Word; specifically I would like to open one or more word documents and allow the user to edit them freely. However I need to keep track of certain key events such e.g. save and close. When the user closes one of the documents I need to inform the background program of the result. The program is written in C++, so far I have no problem opening the documents but I can’t find any C++ examples of event handlers and for document close event etc..

Can anyone help?

Thanks,
0
Comment
Question by:winbiz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 500 total points
ID: 17063846
Following are some articles about MS WORD and event handling..with src samples

Automation and Eventing with Word : http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c2629/

How to catch Word application events by using Visual C++ : http://support.microsoft.com/kb/q183599/

Writing an MS Word addin : http://www.codeproject.com/com/adwordaddin.asp ( refer handling events section )

Hope This Helps.

-MAHESH
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17063861
>>I can’t find any C++ examples of event handlers and for document close event etc..

In above links refer :http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c2629/ <== here close document event is handled..When the Close Document event is received, the number of pages in the document is computed and displayed in the message box ...Refer CWordEventSink::OnDocClose().

Also
In above refer : http://support.microsoft.com/kb/q183599/
Here you may handle 'DocumentBeforeClose' event for your purpose..refer function CAppEventListener::Invoke(..)

-MAHESH
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question