Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6547433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:49:48+00:00 2026-05-25T11:49:48+00:00

I have been looking around for this but couldn’t find an answer anywhere, so

  • 0

I have been looking around for this but couldn’t find an answer anywhere, so hope aomeone here can help.

I am doing a WinForms application in C# in wich i use WordApplcation.CompareDocuments to compare two documents and get a result document with the changes marked as Revisions.

This works well and apart from the revisions hiding stuff inside textboxes (wich i don’t care about just yet) i get exactly what i want.

So next step is to count how many words got revised – specifically wdRevisionDelete and wdRevisonInsert.

Only problem is final.Revisions is sometimes empty or contains enourmous amounts of data (over 500 words).

i read on the MSDN page for Revisions.Count that document.Revisions won’t show all revisions but only ones on main story and that i must use range – but that didn’t help.

here’s my current code:

using Word = Microsoft.Office.Interop.Word;

And

foreach (Word.Section s in final.Sections)
{
        foreach (Word.Revision r in s.Range.Revisions)
        {
                 counter += r.Range.Words.Count;
                 if (r.Type == Word.WdRevisionType.wdRevisionDelete)
                    delcnt += r.Range.Words.Count;
                 if (r.Type == Word.WdRevisionType.wdRevisionInsert)
                    inscnt += r.Range.Words.Count;
        }
}

final is the Word Document created by WordApplication.CompareDocuments

So, as i said, and according to MSDN, i use range.Revision instead of document.Revision, and go section by section.

Only one document with half a dozen revisions shows none while others show 100’s.

So my question is, how to use the Revisions to count added / deleted words.

I have opened the documents that CompareDocuments creates in Word 2007 and the Revisions are correctly marked and can be accepted or rejected inside Word

Any ideias on what i might be overlooking?

EDIT: I have noticed something odd – when i try to save as txt file the original doc files that are reporting 0 changes although the CompareDocuments marks (correctly) a few, i notice that not all pages get saved to the txt file – that includes all areas with revisions.

I tried converting to txt file using both Word 2007 and LibreOffice 3.3 – both have the same result (lot’s of text missing).

Might be related somehow.

Wonder what is wrong with this files.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:49:49+00:00Added an answer on May 25, 2026 at 11:49 am

    Well Apparently there’s nothing wrong with that code and works on simpler files.

    There’s just something odd with the files i was testing on.

    Like my edit says, can’t even save them as txt files properly.

    Anyone knowing what could cause this let me know, meanwhile this one is solved as Word document file problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking around for an answer to my question but couldn't find
I've been looking around on-line for a solution to this, but I can't seem
I've been looking around for a similar question, but I couldn't find one. I'm
I have been googling around this issue, but could not find clear and definitive
I have been looking around ocn Google and Stackoverflow but haven't found what I
I've been looking around for this but cant get my finger on it for
I've been looking around for a solution to this, but haven't quite found one.
We have been having this issue pop up sporadically, but now I can reproduce
I have been looking around for a while, and cant seem to find the
I have been looking around for a solution for this problem that works across

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.