Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-17-2021, 03:43 AM
Downunder Dave Downunder Dave is offline Use VBA to compare Text Box contents between documents. Windows 7 64bit Use VBA to compare Text Box contents between documents. Office 2010
Novice
Use VBA to compare Text Box contents between documents.
 
Join Date: Jul 2021
Location: New Zealand
Posts: 3
Downunder Dave is on a distinguished road
Default Use VBA to compare Text Box contents between documents.

Hi,




I am using Word 2010 for this exercise.


I currently have a piece of VBA that compares two documents (using either the CompareDocuments or Compare methods) and this produces a quick summary of the number of differences, their type (Insert/Delete) and the number of characters involved.



Each of the CompareDocuments or Compare methods produce an interim Results document, just as you get when doing this process manually via the Word toolbar/menu. The Results document I get with VBA clearly shows the text of each difference and whether that difference is within the:
Main Document
Header/Footer
Text Boxes
Header/Footer Text Boxes
Footnotes
Endnotes


Once I create an object of the Results document, I can easily iterate through the differences that are in the Main Document, like this:
For Each dsRevision In oResDoc.Revisions
If dsRevision.Type = wdRevisionInsert Then
sngCharacters = sngCharacters + dsRevision.Range.Characters.Count
End If
Next


My problem is that the VBA Revisions collection only seems to include differences that are in the Main Document and nowhere else.



These differences in other locations are clearly being found, I just cannot inspect them with VBA.


I may be missing something fundamental here. Does anyone know how I can use VBA to iterate across the Revisions that appear in the Footnote/Header and Text Box sections of the Results document ?



Many thanks,


Downunder Dave
Reply With Quote
 

Tags
compare documents, revisions, text boxes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use VBA to compare Text Box contents between documents. Macro to read cell contents and compare data jrfoley3 Excel Programming 7 07-09-2016 12:25 PM
Compare 2007 documents with 2010 documents wardw Word 1 06-09-2016 02:29 PM
compare, match and count cell contents between sheets bobsone1 Excel 11 08-07-2014 10:34 PM
Use VBA to compare Text Box contents between documents. Can you compare two word documents? (Automatically) admin4ever Word 2 05-17-2011 09:44 AM
Compare two word documents gives FORMATT changes for ListItems Jagadeesh Word 0 09-30-2009 07:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft