A
Al
A macro which has operated properly many times in the past halted with an
error this morning. The debugger indicated line 10 below as the error.
After trying to determine why, I did a manual find/replace and the
replace window came up with use wildcards checked. I guess that the last
replace I did yesterday (different document) used wildcards and Word
remembered this setting. How do I unset this in the macro? I am using
Word 2002.
1 Selection.WholeStory
2 Selection.Find.ClearFormatting
3 Selection.Find.Replacement.ClearFormatting
4 With Selection.Find
5 .Text = "^l"
6 .Replacement.Text = " "
7 .Forward = True
8
9 End With
10 Selection.Find.Execute Replace:=wdReplaceAll
11 With Selection.Find
12 .Text = " ^p"
13 .Replacement.Text = "^p"
14 .Forward = True
15
16 End With
error this morning. The debugger indicated line 10 below as the error.
After trying to determine why, I did a manual find/replace and the
replace window came up with use wildcards checked. I guess that the last
replace I did yesterday (different document) used wildcards and Word
remembered this setting. How do I unset this in the macro? I am using
Word 2002.
1 Selection.WholeStory
2 Selection.Find.ClearFormatting
3 Selection.Find.Replacement.ClearFormatting
4 With Selection.Find
5 .Text = "^l"
6 .Replacement.Text = " "
7 .Forward = True
8
9 End With
10 Selection.Find.Execute Replace:=wdReplaceAll
11 With Selection.Find
12 .Text = " ^p"
13 .Replacement.Text = "^p"
14 .Forward = True
15
16 End With