PDA

View Full Version : [SOLVED:] Find/Replace Text with Chr(13) Produces Box Character



Mavila
07-10-2016, 12:38 PM
I'm doing a Find/Replace of text INSIDE A WORD TABLE with Chr(13) but I get boxes instead of the return. Chr(7) works but not Chr(13). Any ideas as to what I should be doing differently to get the actual carriage return instead? It's Times New Roman font. Here is the code:

ActiveDocument.Tables(1).Range.Select
With Selection.Find
.Text = ">P"
.Replacement.Text = Chr(13)
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Thank you!

Paul_Hossler
07-10-2016, 02:36 PM
Try



.Replacement.Text = "^p"

Mavila
07-10-2016, 04:12 PM
Try



.Replacement.Text = "^p"


Worked like a charm! I never would have figured that out. Thank you!