PDA

View Full Version : So Close Yet So Far Away



mtreidl
12-14-2012, 03:41 PM
I want to find and replace two pararaph symbols with one paragraphy symbol ONLY for a given table in my word doc, yet the code I have does it for the entire doc. Can someone provide advise? Thank you!!!


ActiveDocument.Tables(4).Select

With Selection.Find
.ClearFormatting
.Text = "^p^p"
.Replacement.ClearFormatting
.Replacement.Text = "^p"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

macropod
12-14-2012, 07:53 PM
Try:
With ActiveDocument.Tables(4).Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^p^p"
.Replacement.Text = "^p"
.Wrap = wdFindStop
.Forward = True
.Execute Replace:=wdReplaceAll
End With
PS: when posting code, please use the VBA tags.