show MessageBox while opening word document.
-
Monday, April 30, 2012 9:44 AM
I want to display the MessageBox when i open the new document or edit existing document from my SharePoint library.
What i have done is as below,
1. Registered the event handler for the DocumentChange event.
this.Application.DocumentChange += new Word.ApplicationEvents4_DocumentChangeEventHandler(Application_DocumentChange);
2. I am getting the MessageBox when i open the word document/edit existing document from sharepoint document library,
but the issue is if there are more than 1 word documents open & if i change the focus from one document to another, the DocumentChange event gets called & each time the MessageBox gets called & displayed
3. I want the MessageBox to appear when i open new document or edit existing document, but not when i change my focus from one open document to another.
is there any other event or properties which i can use to validate the achieve the above criteria?
Please Mark Post as Answer once you get the solution for your issues.
Thanks,
Kunal Govani- Edited by Kunal Govani Monday, April 30, 2012 9:45 AM
All Replies
-
Monday, April 30, 2012 11:39 AMModerator
Hi Kunal
Use the DocumentOpen event, instead of DocumentChange. That will only fire when a document is opened.
Cindy Meister, VSTO/Word MVP
- Marked As Answer by Yoyo JiangMicrosoft Contingent Staff, Moderator Thursday, May 03, 2012 6:06 AM

