Re: How do I include an attachment to mail merged email?



The code in the macro does rely on the catalog merge producing a table, so
as a minimum, in the maindocument for that merge, you need the mergefields
to be in the cells of a table.

The procedure should be able to be modified to do what you want.

In the catalog merge main document, you will need the field for the email
address and one from which the name of the file attachment can be derived
from the data in the city field such as

C:\Documents\<<city>>.doc

so that the cells in the corresponding column of the catalog merge document
contain the name of the file that is to be attached.

So for a record that has Houston as the city, that field would produce

C:\Documents\Houston.doc

If there was no entry in the city field, it would produce

C:\Document\.doc

If there was no email addresss for one of the records, there would be no
data in the email field of the catalog merge document for that record.

To get the emails only going out to people who have an email address, and
then only to people that have an entry in the city field, you will need to
introduce some If...then...Else constructions into the macro in the article
that checks for the length of the data returned by datarange variable that
is used to get firstly the email address of the addressee and subsequently,
the filename of the attachment.

--
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
"klam" <klam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3EB8FE16-CB2F-4C8B-BF99-7EEEA3EC4011@xxxxxxxxxxxxxxxx
> Hi Doug (and other Mail Merge knowledgeable folks!),
>
> I'm going to tag along on this thread as I have a similar problem. I read
> your article and though it is well written, for an unsophisticated user
> like
> me, it took me a while to get thru but I persisted and finally did
> it...wrong.
>
> I set up a test and made the catalog type file with my e-mail address and
> different file names on five separate lines. (However, my file was not in
> table format as your article shows but I was unsure if you were doing that
> for illustrative purposes only. My e-mail address was separated from the
> file name by a tab spacing, my e-mail address always started on a new
> line.
> If it is actually supposed to be in cells (table), how do you get it to do
> that? I would have thought it would do it on its own automatically.)
>
> My file looked like:
> me@xxxxxxxxxxx testfile1.pdf
> me@xxxxxxxxxxx testfile2.pdf
> .
> .
> .
>
> When I ran the macro, it gave me the Outlook warning message which I
> expected. I pressed YES six times, but when it kept on asking I pressed
> NO.
> I only had 5 test lines in file. In Word I could see Doc241 being
> created.
> Where was it getting all the e-mail addresses from? Worse yet, when I
> checked my Outlook, I received no messages from this!
>
> What I really want done is slightly different but I thought this would be
> a
> good base from which I could improvise. In case there's an easier way to
> go
> about it, here's what I'd really like to do:
>
> I have an Excel file that contains Names, E-mail, City column labels.
> There will be a Name in every cell under that column. Only some cells
> will
> have an e-mail, and only some cells will have City populated. The City
> will
> be limited to 6 choices.
>
> I would like to e-mail all the people with the same city the same
> attachment
> (i.e., the attachment is city-specific). I think the mail merge feature
> is
> needed but I'm not quite sure how.
>
> My workaround is to sort the list by city then e-mail address, make a new
> distribution list in Outlook for each of the 6 cities and cut and paste
> the
> respective e-mails into the different distribution lists, then e-mail the
> each distribution list its city-specific attachment. However, there are
> many
> names on the list so this could take quite a while.
>
> Using Word 2000 on XP
> thx for any suggestions.
>
> "Doug Robbins" wrote:
>
>> See the article "Mail Merge to E-mail with Attachments" at
>>
>> http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.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
>> "Kathy" <Kathy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:5D4FEDA7-D5B9-42CA-A035-F84787216AAD@xxxxxxxxxxxxxxxx
>> >I have to send out over 100 emails each with a specific attachment. How
>> >can
>> >I
>> > do this through mail merge? The only difference to each email and
>> > attachment
>> > will be the addressee.
>>
>>
>>


.



Relevant Pages

  • Re: How do I include an attachment to mail merged email?
    ... > to be in the cells of a table. ... > So for a record that has Houston as the city, ... > If there was no entry in the city field, ... > Doug Robbins - Word MVP ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word 2007 mail merge for catagory listing, not listing in the return of the data.
    ... it was called Catalog) type? ... result to sort the data with a heading and sub information. ... " ""}{SET PLACE1{MERGEFIELD CITY}} ... {MERGEFIELD CITY} ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Set text field to a certain value using a script -FM 8
    ... If this is the only thing that the Multiple City field does, ... york" in the multiple field and if its "Los Angeles" then I need it to ...
    (comp.databases.filemaker)
  • Re: Which function to use?
    ... If the result of this countif calculation yielded an answer which is greater ... then obviously the whole column has one or more cells in it ... Harald used the MAX and MIN functions to achieve a similar outcome. ... You mentioned that values for one city could be positive, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Seperating information in a cell
    ... Mary Anne Jones ... Tom Della Rossa ... several cells? ... I want to have first name, last name, street address, city, state ...
    (microsoft.public.excel.worksheet.functions)