Store and Restore Find Settings:   Return to List

' Can use code below to store & restore find to original settings

Code to store find settings:

storedtext = Selection.Find.Text
storedrepl = Selection.Find.Replacement.Text
storedforward = Selection.Find.Forward
storedwrap = Selection.Find.Wrap
storedformat = Selection.Find.Format
storedbold = Selection.Find.Font.Bold
storedcolor = Selection.Find.Font.ColorIndex
storedhighlight = Selection.Find.Highlight
storedcase = Selection.Find.MatchCase
storedwhole = Selection.Find.MatchWholeWord
storedwild = Selection.Find.MatchWildcards
storedsound = Selection.Find.MatchSoundsLike
storedforms = Selection.Find.MatchAllWordForms

Code to restore stored settings:

With Selection.Find
    .Text = storedtext
    .Replacement.Text = storedrepl
    .Forward = storedforward
    .Wrap = storedwrap
    .Format = storedformat
    .Font.Bold = storedbold
    .Font.ColorIndex = storedcolor
    .Highlight = storedhighlight
    .MatchCase = storedcase
    .MatchWholeWord = storedwhole
    .MatchWildcards = storedwild
    .MatchSoundsLike = storedsound
    .MatchAllWordForms = storedforms
End With



Note to Webmaster