I am importing records from an Access database into Word. I have another program feeding the data into Access. My problem is that one of the fields in Access is a memo field where users enter bibliographic information and have to italicize certain words. If they use <i></i> around what needs to be italicized, it looks good on the web but the <i></i> shows up in Word when the records are merged.
All I want to do is use something that tells word to take anything inside the <i></i> tags and italicize it and then delete the tags. Any suggestions?
Merge to a new document and use the replace function to remove the tags and
italicise the text - the following macro will do the job:
Sub ReplaceItalicTags()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\<i\>(*)\</i\>"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I am importing records from an Access database into Word. I have
> another program feeding the data into Access. My problem is that one
[quoted text clipped - 6 lines]
> inside the <i></i> tags and italicize it and then delete the tags.
> Any suggestions?