Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-29-2023, 05:37 PM
Guessed's Avatar
Guessed Guessed is offline In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve? Windows 10 In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Those two lines remove any possible remnants of formatting from the Find and Replace dialog before you set the new search parameters. This is necessary sometimes if a previous find and replace was performed and you had set a particular format to go along with either the find string or the replace with. For example, if you did a search for the word Title and only wanted to find the instances that were bold and then you wanted to assign it as a Heading 1 style then the bold would be a find format and the style setting would be a find.replacement format.

Those settings are sticky - which means the settings are remembered if you close the dialog and then later re-open it without restarting Word.

Those lines of code remove those format settings to the find/replace doesn't retain anything you forgot about.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro Matt C Excel Programming 2 01-08-2022 06:03 AM
In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve? Creating a "super macro" with all kind of functions Xanthopteryx PowerPoint 1 06-16-2016 01:38 AM
How to send "clean" copy after tracking/ redlining changes in review mode lindapaul Word 2 06-09-2016 02:34 PM
remove repeated words with " macro " or " wild cards " in texts with parentheses and commas jocke321 Word VBA 2 12-10-2014 11:27 AM
In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve? How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:52 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