Thanks macropad, good idea, but as is it won't work for me here. My
mergefield is one text string, not a series of separate mergefields. By the
time the field gets to my Word document, the original database fields have
been put together into one string.
The only thing I can be sure of is that the substring I want to highlight
will appear only once in the whole string. I can't be sure where it will be,
how long it will be, or how long the whole string will be.
John
Hi John,
In that case, you'll need to run a macro over the merged document to search
out the date strings, plus the preceding text up to and including the '$'
symbols. Might be a problem if the same date appears anywhere else in the
body of the document, though.
Cheers

Signature
macropod
[MVP - Microsoft Word]
> Thanks macropad, good idea, but as is it won't work for me here. My
> mergefield is one text string, not a series of separate mergefields. By the
[quoted text clipped - 22 lines]
> > for the date; and
> > {IF{DATE \@ yyyyMMdd}= {MERGEFIELD MyDate \@ yyyyMMdd} {MERGEFIELD
MyAmount
> > \# $,#} {MERGEFIELD MyAmount \# $,#}}
> > for the amount.
[quoted text clipped - 28 lines]
> > >
> > > Any suggestions appreciated.
John in Saratoga - 15 Nov 2006 04:29 GMT
Thanks macropod,
I think you're right that a macro could do it. I've never written a macro
that runs once for each merged document between the merging and the printing.
I'd have to research how to do that.
One approach that failed was to apply the formatting to the data source
file. I couldn't find a format with which Word would preserve
formatting/highlighting during the merge.
Another idea: In the source file, split the string into three substrings,
(1) before the search substring, (2) the search substring, (3) after the
search substring. Then mailmerge three fields instead of one, with the center
one appropriately formatted.
I don't yet know if this pre-merge processing of the source file would be
easier than writing the merge-time macro you suggest.
Thanks for your suggestions. I wish I had one that's as simple as your
original proposal. I'll need to do this frequently, and I'd rather not do
outside-of-Word processing.
John
> Hi John,
>
[quoted text clipped - 17 lines]
> >
> > John
Peter Jamieson - 15 Nov 2006 14:01 GMT
What is the "original" data source? and what is actually in the string? i.e.
is it
Due: $100 on 11/5/2006; $120 on 12/6/2006; $80 on 1/5/2007
$100 on 11/5/2006; $120 on 12/6/2006; $80 on 1/5/2007
or what? Are there always three values separated by ";" ? Are the dates
always M/D/YYYY/ etc.? Is one of them always highlighted, or is /at most/
one highlighted?
Personally I would consider
a. trying to "re-split" the data into three fields in an SQL statement and
using the approach macropod first suggested, or
b. using mail merge events to process the data record-by-record
Peter Jamieson
> Thanks macropod,
>
[quoted text clipped - 47 lines]
>> >
>> > John
John in Saratoga - 15 Nov 2006 15:53 GMT
Thanks Peter.
Right now the source is a string with "Due" already in it and always with
three values. I think I will experiment with both approaches -- parsing the
string and splitting it into its components (using SQL or otherwise), and
also using mail merge events.
Thanks for the suggestions. I'm sure one of them can work out.
John
> What is the "original" data source? and what is actually in the string? i.e.
> is it
[quoted text clipped - 13 lines]
>
> Peter Jamieson