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
|