Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
George Adams George Adams is offline
external usenet poster
 
Posts: 4
Default Trigger a find/replace on mail merge?

I'm trying to make a directory, pulling in data from an ODBC database to
make a mail merge. For simplicity, let's just say the template looks
like this:

{ MERGEFIELD "lastname"}, { MERGEFIELD "firstname" }

All well and good. The only problem is that the database stores any
special characters as HTML entities (since the DB is primarily used for
displaying the directory on the web). Thus, the accent characters in
Jose Pinera (over the "e" in "Jose" and "n" in "Pinera") are stored in
the database as:

lastname: Piñera
firstname: José

Now, there are only a few of these, so a few search/replace commands
should be able to convert the HTML entities back into the actual
letters. I can't figure out how to incorporate this into the mail
merge, though. Is it possible to setup my document such that, with a
single push, the mail merge can run and a find/replace function can go
through "lastname" and "firstname", replacing all the HTML entities I
specify with their actual (ISO-8859-1) characters?

Thanks to anyone who can help!
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Trigger a find/replace on mail merge?

If you record a Word macro that merges to an output document, you can then
modify that macro so that it also does a number of find/replace operations
on the output document. All you really need to know is that when the merge
is complete, the output document is the ActiveDocument (if you need to do
things to the Mail Merge Main DOcument post-merge, make a reference to it
before you execute the merge).

You'll probably find plenty of samples of find/replace VBA code in the
word.vba newsgroups here, and probably at http://word.mvps.org as well.

Peter Jamieson
"George Adams" wrote in message
...
I'm trying to make a directory, pulling in data from an ODBC database to
make a mail merge. For simplicity, let's just say the template looks
like this:

{ MERGEFIELD "lastname"}, { MERGEFIELD "firstname" }

All well and good. The only problem is that the database stores any
special characters as HTML entities (since the DB is primarily used for
displaying the directory on the web). Thus, the accent characters in Jose
Pinera (over the "e" in "Jose" and "n" in "Pinera") are stored in the
database as:

lastname: Piñera
firstname: José

Now, there are only a few of these, so a few search/replace commands
should be able to convert the HTML entities back into the actual letters.
I can't figure out how to incorporate this into the mail merge, though.
Is it possible to setup my document such that, with a single push, the
mail merge can run and a find/replace function can go through "lastname"
and "firstname", replacing all the HTML entities I specify with their
actual (ISO-8859-1) characters?

Thanks to anyone who can help!


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 07:48 PM
Mail Merge & Find/Replace [email protected] Mailmerge 10 May 11th 06 06:35 AM
Using find and replace or macros to replace page ranges JeremyC Microsoft Word Help 7 February 13th 06 09:20 PM
Find/ Replace is auto-capping the words I want to replace with Graham Mayor Microsoft Word Help 8 January 27th 06 01:39 AM
Is it possible to use find replace for Merge Field data Chris Mailmerge 1 August 22nd 05 03:58 PM


All times are GMT +1. The time now is 02:33 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"