PDA

View Full Version : [SOLVED:] comparing paragraph in multiple word documents to identify the possible variables



Laulou95
11-26-2015, 08:28 PM
I have approximately 278 html files in a folder that will be changed to merge documents. I have been doing this manually, opening each html file, removing residual graphics, correcting formatting errors where applicable, then reading through each document to find the paragraphs with changes. I have searched the internet for a macro to speed up the process but found none. So, I am asking someone to create one or two for me?
I can record and run a basic macro using any version of word but cannot write one. So, if you can please create the entire code and include instructions on how to run it.


Thanks so very much for your help.


the macro, should
prompt me to select the folder with the html files
prompt me to select the folder to save the converted word (.docx) files


after all the files and converted and saved to the word folder
open each of the converted word files and allow me to run my clean up macros
so I guess I would need another message box prompt (click ok when complete).

then close and save each (back to the same folder)


after all the clean up is completed, the macro should:
Open the first document and the second document


compare each paragraph of the first document to each paragraph of the second document.
ignore tables graphic and empty lines.


If a match is found, change the color of the unique text in that paragraph dark red then move to the next paragraph of the first document and begin comparing against the first paragraph of the second document.


if no match is found, then compare the paragraph in the first document to the next paragraph in the second document
continue to the end of the second document then compare the next paragraph to the firs paragraph in document
save the compared documents with a new name that combines the name of the compared file in a new folder (prompts to select the folder and continues on ok)


continue until there is no more files in the files in the original folder.
the macro is treating each paragraph as separate document and comparing as with the document compare feature in word.



comparing example:


Document 1lamb

Document2 dog



Paragraph 1 Mary had a little lamb its fleece was white as snow. And everywhere that Mary went the lamb was sure to go. Lovely day.

Paragraph 1 the quick brown fox jumped over the lazy dog. The dog did not look at the quick brown fox.



Paragraph 2. The nimble brown fox jumbled over the tired dog. The dog got a piece of the quick brown fox tail.

A twister of twist once twisted a twist and the twist that he twisted was a three twisted twist. Now in twisting that twist if one twist were to untwist, it would untwist the three twisted twist that the twister of twist had twitted.



The compared document would look like:


Document lambdog



Paragraph 1
Mary had a little lamb its fleece was white as snow. And everywhere that Mary went the lamb was sure to go. Lovely day.



Paragraph 2.
The nimble brown fox jumbled over the tired dog. The dog got a piece of the quick brown fox tail.