show MessageBox while opening word document.

Answered show MessageBox while opening word document.

  • Monday, April 30, 2012 9:44 AM
     
      Has Code

    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


All Replies