Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-15-2022, 05:16 PM
macropod's Avatar
macropod macropod is offline loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Windows 10 loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The line '.Close SaveChanges:=True' only re-saves the document if any changes have actually been made. The problem lies in your code, which explicitly updates wDoc.BuiltInDocumentProperties(wdPropertyComments) without checking whether any changes have been made or whether it already matches strRplc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Loop Through all documents in a folder ballpoint Word VBA 10 08-15-2022 05:24 PM
loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Macro to Change Document Font in All Documents in a Folder jtomolonis08 Word VBA 1 06-07-2019 05:59 PM
loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Can't Find Word Document in Search or in Folder But It's There in Recent Documents CrossReach Word 1 10-14-2016 01:27 PM
loop through all documents in a folder, search and replace text, save document ONLY IF CHANGE MADE Find & replace footer text in a folder of Word 2010 documents kennethc Word 3 03-28-2015 02:49 AM
how to search and replace BOLD text >> font color change? dylansmith Word 4 03-12-2013 09:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 PM.


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