Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / July 2004

Tip: Looking for answers? Try searching our database.

Italicizing text WITHIN a mail merge field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brent - 14 Jul 2004 22:18 GMT
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?
Graham Mayor - 15 Jul 2004 16:22 GMT
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?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.