Track Revisions For Two Strings

G

George Lee

Is it possible to do a programmatic compare between two strings to get the
revision status (mark the new text and strikethrough the old) without using
the file based Compare and Merge option? If so, how?
 
D

Doug Robbins - Word MVP

Rather than re-invent the wheel,

Dim str1 As String
Dim str2 As String
Dim doc1 As Document
Dim doc2 As Document
str1 = "some text"
str2 = "some different text"
Set doc1 = Documents.Add
doc1.Range.Text = str1
Set doc2 = Documents.Add
doc2.Range.Text = str2
doc2.SaveAs "c:\doc2.doc"
doc2.Close
doc1.Compare "C:\doc2.doc", , wdCompareTargetNew
Kill "c:\doc2.doc"
doc1.Close wdDoNotSaveChanges


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top