Maybe not so elegant, but consider using a separate catalog type mailmerge
run from the same datasource with the mergefields that contain the values to
be used as parameters in the cells of a one row table in the catalog
mailmerge main document. Then after executing both merges, iterate through
the rows of the catalog table, grabbing the values, using them and dumpting
the result of the function into the corresponding Section of your present
mailmerge document.
If you wrap it all up in code, you would hide the inelegancy.
That sort of iteration through a catalog mailmerge is done n the code in the
article "Mail Merge to E-mail with Attachments" at
http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm

Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
> Hello, I have an application which uses the Word object model to do a mail
> merge programmatically, with an Access database as the datasource.
[quoted text clipped - 14 lines]
> Thank you for any suggestions, I have scoured the FAQs, scoured Google and
> Teoma, I am at a standstill on how to do this. :-/
Alan - 18 Nov 2004 14:37 GMT
Hi Doug and thanks very much for taking the time to respond.
I'm not sure whether I can do this catalog type mailmerge, because I don't
have direct access to the datasource through my template. The app which
programmatically performs the mail merge is what I'm trying to not touch. I
would love to be able to do this if at all possible by having the merged
document take the field values, perform the calculation, and then populate
the textbox or field with the result that I need to have, without having to
touch the datasource directly, but rather using the values already placed
into the merged doc...
> Maybe not so elegant, but consider using a separate catalog type mailmerge
> run from the same datasource with the mergefields that contain the values
[quoted text clipped - 29 lines]
>> Thank you for any suggestions, I have scoured the FAQs, scoured Google
>> and Teoma, I am at a standstill on how to do this. :-/