Please help me find the third Tab Character in each paragraph and replace it
with a Manual Line Break.

NB I might need to change to second or fourth Tab Character.

Francis Hookham
(I thought I had posted this request but I cannot find it - please excuse me
if this IS the second request)

Re: Replace tab with break by Jean-Guy

Jean-Guy
Fri Sep 01 16:47:58 CDT 2006

Francis Hookham was telling us:
Francis Hookham nous racontait que :

> Please help me find the third Tab Character in each paragraph and
> replace it with a Manual Line Break.
>
> NB I might need to change to second or fourth Tab Character.
>
> Francis Hookham
> (I thought I had posted this request but I cannot find it - please
> excuse me if this IS the second request)

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(*^t*^t*)(^t)(*^13)"
.MatchWildcards = True
.Wrap = wdFindContinue
.Forward = True
.Replacement.Text = "\1^l\3"
.Execute Replace:=wdReplaceAll
End With

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Replace tab with break by Klaus

Klaus
Sun Sep 03 20:28:14 CDT 2006

>> Please help me find the third Tab Character in each paragraph and replace
>> it with a Manual Line Break.

"Jean-Guy Marcil" <NoSpam@LeaveMeAlone> wrote:
> .Text = "(*^t*^t*)(^t)(*^13)"
> .Replacement.Text = "\1^l\3"


Hi Jean-Guy,

Very nice pattern! It took me a while to see why this expression always
works, and it's really not easy to find something that works both for
paragraphs that start with text, and with a tab.

.Text = "(*^t*^t*)(^t)(*^13)"
does the trick because the pattern matching stops each tentative match
(whether successful or not) when it encounters a ^13, and then starts anew
right after each paragraph mark.

Regards,
Klaus