Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I create a macro that uses the Replace command?
I am trying to create a macro that will delete all bold text using Edit and
Replace. I create the Macro, but it does not work. I think it may have something to do with the dialog boxes that pop up after the replacements. Any advice? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How do I create a macro that uses the Replace command?
It has more to do with the inability of the macro recorder to record all the
replace functions. You will have to add the extra lines: eg to remove all emboldened text (as opposed to removing the bold attribute) Sub ReplaceExample() Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find '********************** .Text = "" .Font.Bold = True .Replacement.Text = "" '********************** .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org beverlydawn wrote: I am trying to create a macro that will delete all bold text using Edit and Replace. I create the Macro, but it does not work. I think it may have something to do with the dialog boxes that pop up after the replacements. Any advice? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I assign a macro to a command button | Microsoft Word Help | |||
BUG with replace command | Microsoft Word Help | |||
Why can't I use the Copy command in a macro? | Microsoft Word Help | |||
How can I create a macro to find and replace text attributes? | Microsoft Word Help | |||
automate command button in a macro | Mailmerge |