none
Compare two word documents in VSTO add-in RRS feed

  • Question

  • Hi,

    I have created VSTO word add-in for office 2010.I have created custom buttons inside the custom tab.On buttonn click I would like to do compare two documents based on user input.

    There are two scenarios for compare :

    1.User open a blank document and click compare button(custom button).It will show the popup with document list.User can able to select two documents to compare and click ok button.Once Ok button clicked compare results should show in a new window.

    2.User open existing document and click compare button(custom button).It will show the popup with document list.User can able to select only one document since he wants to compare the opened document and click ok button.Once Ok button clicked compare results should show in a new window.

    How to do this in Globals.thisaddin.application object.

    Could you please suggest

    Regards,

    Karthik.K

    Tuesday, July 21, 2015 4:07 PM

Answers

  • Hi Karthik.K,

    >>1.User open a blank document and click compare button(custom button).It will show the popup with document list.User can able to select two documents to compare and click ok button.Once Ok button clicked compare results should show in a new window.

    2.User open existing document and click compare button(custom button).It will show the popup with document list.User can able to select only one document since he wants to compare the opened document and click ok button.Once Ok button clicked compare results should show in a new window.

    How to do this in Globals.thisaddin.application object.<<

    Based on my understanding, we are not able to detect whterer the document was open a blank document or the existing document. We may compare the Name and FullName of document, if they are equal the document is not saved on the disk.

    And to compare the documents, we can use Document.Compare to display revision marks that indicate where the specified document differs from another document.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, July 22, 2015 8:37 AM
    Moderator