none
How to accept/reject changes in MS Word using visual C# RRS feed

  • Question

  • Does anyone know how to accept or reject changes in an MS Word 2007 document based upon the reviewer identity in C# ??

    For example, suppose that person A, B, and C made changes to the same document. I would like to write an application

    that would reject the changes made by person A & B, and then accept the changes made by person C.

     

    Thanks,

    clipsemeister

    • Moved by CoolDadTx Monday, March 28, 2011 5:03 PM Not IDE related (From:Visual C# IDE)
    • Changed type Cindy Meister MVPModerator Thursday, April 7, 2011 1:21 PM it's a question
    Monday, March 28, 2011 5:01 PM

All replies

  • Hello clipsemeister,

     

    It all depends on where the revisions have been made. This is what i propose to you:

     

     

       for (int i = 1; i < RangeThatHasRevisions.Revisions.Count; i++)
     {
     if (RangeThatHasRevisions.Revisions[i].Author.Equals(A) || RangeThatHasRevisions.Revisions[i].Author.Equals(B))
     {
     RangeThatHasRevisions.Revisions[i].Reject();
     }
    else

     {
     if (RangeThatHasRevisions.Revisions[i].Author.Equals(C))
     {
    RangeThatHasRevisions.Revisions[i].Accept();
     }
    }
    }

    The RangeThatHasRevisions can be anything of type Microsoft.Office.Interop.Word.Range. (a paragraph, a contentcontrol, event the whole document).

    Hope this is of some help.

     

    Best regards,

    Silviu.


    http://www.rosoftlab.net/
    • Proposed as answer by Lupu Silviu Monday, May 16, 2011 6:05 AM
    Thursday, April 7, 2011 1:03 PM
  • Hello clipsemeister,

     

    Did this do the trick? :)

     

    Best regards,

    Silviu.


    http://www.rosoftlab.net/
    Tuesday, April 19, 2011 8:50 AM
  • Yes, thank you very much!
    Friday, May 13, 2011 3:51 PM