Using 2+ different e-mail lists?

T

Trey

Hi again,

Tangentially related to my previous inquiry "Very Challenging Project" -- I
was trying to execute an e-mail merge in Word using data from an Access
table. The e-mail addresses I want to send to are located in the table
itself. There are a few different e-mail columns/fields in the tables (e.g:
one column is Manager E-mail. another is Planner E-mail). It's easy enough to
get the Word filter to point to one of the fields and mail to those
addresses...but what if I want to send e-mails to _all_ addresses in the
entire table? Will I have to run one merge for each field? Or is there a
workaround so I can merge and e-mail to everyone in one shot?

Thanks again!

-Trey
 
D

Doug Robbins

You will need to resort to VBA to send to multiple email addresses. Some of
the code you will need is in the article
"Mail Merge to E-mail with Attachments" at

http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm

and I based that on the second method in the article

"How to send an email from Word using VBA" at:

http://word.mvps.org/FAQs/InterDev/SendMail.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

Peter Jamieson

Will I have to run one merge for each field?

Yes, unless you follow the suggestions Doug has made or are
a. either able to design a query that returns one record for each distinct
e-mail address in each record and which can also be used as the data source
for a merge (and be aware that if you need to use a UNION query to do this,
the query may not be listed when you try to connect to it from Word
b. or able to modify the structure of your database to take account of this
requirement.

An example of the sort of UNION query (let's call it myquery) that could do
(a):

SELECT ID, manager_email AS 'email' FROM mytable WHERE manager_email IS NOT
NULL
UNION
SELECT ID, planner_email AS 'email' FROM mytable WHERE planner_email IS NOT
NULL

where ID consists of the primary key field(s) of mytable. (I may have got
some of the details wrong in here, e.g. used the wrong sort of quotes around
'email' etc).

To use this as part of a data source, you would need another query such as

Select * FROM myquery, mytable WHERE myquery.ID = mytable.ID

(or use an INNER JOIN if you prefer)

But as I say, you might not be able to connect to this query, at least using
the default connection method (OLEDB).

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top