View Single Post
 
Old 11-29-2023, 12:28 PM
ctviggen ctviggen is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Feb 2021
Posts: 54
ctviggen is on a distinguished road
Default In a macro to clean up language, what functions do "ClearFormatting" and "Replacement" serve?

I have a macro I've been using that cleans up documents. For instance, for the sentence "This is like X i.e. which is like Y", my macro adds commas before and after "i.e.": "This is like X, i.e., which is like Y".

This macro has the following code at the beginning:

Code:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
I have determined what "ClearFormatting" does, but why do I have two statements in a row like this, and what does "Replacement" add?

(The macro works fine, but I added something before these lines, and went to comment these lines...only to realize I'm not sure what they do.)
Reply With Quote