R
Rose
How do I replace Pipe |NAME| character with [NAME] square brackets in below
macro:
Stuck!
Option Explicit
Public Sub FindReplacePipe()
'Find replace [ ]
Dim replacement As String
replacement = InputBox("Enter the replacement text", "Replacer")
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="|[A-z]{1,}|", ReplaceWith:=replacement,
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
End Sub
macro:
Stuck!
Option Explicit
Public Sub FindReplacePipe()
'Find replace [ ]
Dim replacement As String
replacement = InputBox("Enter the replacement text", "Replacer")
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="|[A-z]{1,}|", ReplaceWith:=replacement,
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
End Sub