We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

HasChanges question

I'm doing a replace of text in a doc

However, I don't want to save the file, if there are no actual replacements. My code is this:
doc = New WordDocument(sFilename)
doc.Replace(sOldText, sNewText, GetCase(ck), True)

If doc.HasChanges = True Then
' I save the file here

However, doc.HasChanges always returns FALSE, even after the replacement.

How can I find out if the file has been changed (replacements have been made)?

1 Reply

VS Vijayakumar S Syncfusion Team September 15, 2009 04:30 AM UTC

Hi David,

Thank you for posting your query.

WordDocument.HasChanges property has no effect on changes to the document that you make programmatically via Essential DocIO. The changes that you make via Essential DocIO are never tracked as revisions.

For more information on track changes in the document, please refer the following link

http://help.syncfusion.com/ug_73/docio/TrackingChanges.html

We prepared a sample for your requirement without using WordDocument.HasChanges, could you please have a look at the sample in the below link and let us know if this helps.

http://files.syncfusion.com/support/DocIO.Windows/F89983/89983.zip

Please let us know if you have any questions.

Regards,
Vijay

Loader.
Live Chat Icon For mobile
Up arrow icon