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 / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Mail Merge Madness!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan - 18 Nov 2004 08:59 GMT
Hello, I have an application which uses the Word object model to do a mail
merge programmatically, with an Access database as the datasource.

I need to basically do the following, one merged document at a time...

   1.  Take values which the merge process places into certain fields, and
use these values as parameters for a function within the template

   2.  Use the value resulting from the function to populate a line of text
at the bottom of each merged document

This needs to happen for each Word doc.  I don't want to mess with the code
in the application which is performing the merge, I want to be able to have
the Word object model's events direct the stuff from within the mail merge
template doc...  is this possible?!?!?

Thank you for any suggestions, I have scoured the FAQs, scoured Google and
Teoma, I am at a standstill on how to do this.  :-/
Doug Robbins - 18 Nov 2004 11:22 GMT
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.  :-/
 
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.