Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2008

Tip: Looking for answers? Try searching our database.

Track Revisions For Two Strings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George Lee - 06 Feb 2008 13:40 GMT
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?
Doug Robbins - Word MVP - 13 Feb 2008 00:38 GMT
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

Signature

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

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.