Click to See Complete Forum and Search --> : Comparing 2 word docs and extracting the missing/extra letter


blitzkrieg78us
May 29th, 2006, 08:27 AM
Hi all,
I have 2 word documents.I have to make string comparison of both the files and highlight the extra/missing string by underlining it or marking it by bold and write the resultant to a xml file or a word file.Can anyone help me in finding a solution for this issue?Is this possible?

for e.g
content of 1st doc
Lord Krishna was born in Mathura.His uncle's name is kamsa.He is imbecile to his citizen.Lord Krishna killed him.
content of 2nd doc
Lord Krishna was born in Mathura.His uncle's name is kamsa.He is imbecile to his citizen.Lord Krishna killed him with his brother Balaram.

The output should be
with his brother Balaram. should be highlighted in the third document
either underlined or made bold or some sort of marking

Comparison has to be made para by para bfore every carriage return(Enter key)

Igor Soukhov
May 30th, 2006, 12:24 AM
All you need to do is to convert .doc file into text file. The easiest way to do it - usinng MS Word document object. Have a search on MSDN for "MS Word Object Model" - this will give you idea how to create Word object, how to load contenc of the .doc file into the object and how to extract and save text data into text file.

Hi all,
I have 2 word documents.I have to make word by word comparison in each line of the first with that of the second and pull out the extra/missing word and write it to a xml file.I was successful in writing a text file to xml filebut im unable to write the contents of a .doc file to xml file.The word can even be a character like comma,space etc.Can anyone help me in finding a solution for this issue?

for e.g
content of 1st doc
All the best for your exams
content of 2nd doc
All the best for your semester exams

xml file should be like this
<tag>semester</tag>
Here semester is an additional word