Re: Modify text between certain tags by Doug
Doug
Sat Jan 24 17:49:29 CST 2004
Use
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Execute FindText:="_", ReplaceWith:=" ", Replace:=wdReplaceAll,
MatchWildcards:=False
Do While .Execute(FindText:="(##)([A-z 0-9]{1,})(##)",
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Bold = True
Selection.Range.Text = Mid(Selection.Range.Text, 3,
Len(Selection.Range.Text) - 4)
Loop
End With
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"just me" <no.spam@to.me> wrote in message
news:pan.2004.01.25.01.20.31.717310@to.me...
> Hi all!
>
> How to modify (i.e. toggle bold) all the strings in document which are
> between certain tags? Strings are like: ##THIS_IS_A_STRING##
>
> Spaces between tags "##" are not allowed. So, all the occurences in the
> Word document should be modified, how could this be done?
>