View Single Post
  #4   Report Post  
Graham Mayor
 
Posts: n/a
Default

Thew following provides an example of how formatting changes can be added to
the macro.

Sub ReplaceExample()

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
'**********************
.Text = ""
.Font.Name = "Arial"
.Font.Bold = True
.Font.Size = "12"

.Replacement.Text = ""
.Replacement.Font.Name = "Bookman Old Style"
.Replacement.Font.Size = "11"
.Replacement.Font.Italic = True
'**********************
.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



pubgal23 wrote:
Hello, I am working in Word 2003 and am trying to recreate a ton of
macros we had made in WP, one set of them involves finding a text
attribute, or finding and replacing it with something else. I can
obviously do this, one by one, with the find and replace
commands...however, for some reason I can't get it to "stick" in the
macro.

Two examples of what I am trying to create would be:

1. Find next bold.

2. Find next underline and change to italics.

anyone have any suggestions?
thanks!