Can you send a mail merge to a large group WITH an attachment?

L

LMK@work

I want to do a mail merge with 400+ recipients. Is it possible to attach a
PDF file?
 
L

LMK@work

I've checked out the article, but it's like reading Greek. I've gotten as
far as "Setup" and then I'm completely lost. That first sentence just keeps
going, and having never worked with macros I have no idea what it is I'm
supposed to be doing. I don't even see anything in the Visual Basic Editor
about Catalogues or Directories. Help?
 
D

Doug Robbins - Word MVP

See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at:

http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

You need to read the article more carefully. The reference to catalogs or
directories has nothing to do with Visual Basic. They are a type of
mailmerge.

Post back here with any specific questions that you have.


--
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
 
L

LMK@work

Thank you for clearing that up. Even with the clarification, though, I'm
still having trouble figuring out what that first sentence means. Is "type"
being used as a verb or a noun in "You will need to create a separate
Directory type mail merge main document"? When the article says, "which
creates a word document containing a table in each row...", does that mean
this table should be automatically created or I need to create a table?
Right now I have three word files, my source with email addresses, my
message, and this additional Directory. I understand what the outcome of
this process should be, but I'm completely missing how to get there. I'd
appreciate further clarification. Thanks.
 
D

Doug Robbins - Word MVP

"type" is a noun

The following:

You will need to create a separate Catalogue (or in Word 2002 and later,
Directory) type mail merge main document which creates a word document
containing a table in each row of which would be data from the data source
that contains the email address in the first column and the Drive:\Path...

could read:

You will need to create a separate Catalogue (or in Word 2002 and later,
Directory) type mail merge main document which, when executed, creates a
word document containing a table in each row of which would be data from the
data source that contains the email address in the first column and the
Drive:\Path

But, if you just read on and follow each step, you will come to:

You first execute that mail merge to a new document, which if you have set
it up correctly will produce a document containing a table similar to the
following:

and, there are examples of what that document would look like.
--
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
 
D

Doug Robbins - Word MVP

Take it one step at a time. I don't think that I could write in a simpler
way than I have. Post back to the newsgroups if there are any parts that
you really do not understand.

--
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
 
D

Doug Robbins - Word MVP

The document that is referred to here is what will become the body of the
email message. It needs to be a formletter type mailmerge document that
uses the same data source as the catalog or directory type mailmerge main
document that is referred to elsewhere in the article.

The document does not have to contain anything much, but it will need to
have at least one merge field in it. A typical one might be

Dear <<Name>>,

Attached is the file.

Yours,
etc.

When you execute that merge to a new document, that document will contain
replicas of that "letter/message" for each recipient such as

Dear Tom,

Attached is the file.

Yours,
etc

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Dear Dick,

Attached is the file.

Yours,
etc

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Dear Dick,

Attached is the file.

Yours,
etc

The double dotted lines above are intended to represent the Section Breaks
that are inserted between each of the letters when the merge is executed.

It is when that document is the active document that you run the macro.

NOTE: You must do absolutely everything as it says in the article otherwise
it will not work.

I would suggest that you set up a dummy datasource containing a few records
in which you have your own email address (or that of a co-worker or friend)
as the email address for each record and go through the process using that
data source (for both the catalog/directory and the formletter merge
mentioned above) to check that everything is working correctly. If it is,
then that addressee should receive as many emails as there are records in
that dummy data source, to each of which should be attached the files that
are listed in the catalog/directory mailmerge.

--
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
 
H

Hen-loss

I followed all the steps (spent the day working on it). Everything appeared
fine but when I went to do the final test and re-did all the steps- just in
case- I end up with an error message and now I am absolutely lost.

I created a directory type file containing the email addresses and file
locations.
I set up the macro as directed.
I created a form mail (to be used as the main message in the body of the
email message) which followed your model of Dear <<Name>>...
I merged this and saw the letters with the page breaks as you demonstrated.
I then applied the macro... and... well... that's when I get the message
saying : "Can't execute code in break mode"

What am I doing wrong?

Thanks!

Hen-loss
 
P

Peter Jamieson

It usually means that VB encountered an error in themacro you just ran.
Typically, if you are running the macro with the VB Editor open, you would
see a highlighted line of code where the error occurred. If that's the case,
you may obviously need to fix the error before proceeding, but otherwise try
clicking the "Reset" button (small square like the stop button on a remote
control) before running the next bit of code.

Peter Jamieson
 
A

alexandros.papadopoulos

DLS, I can feel your pain as I just spent a couple of hours reading a
two-paragraph HOWTO and feeling stupid. I believe it could be written in
simpler words, along these lines:

1. Start with a fresh Word document. Go to Tools -> Macro -> Visual Basic
Editor

2. In the Visual Basic Editor window, go to Tools -> References and make
sure that an item called "Microsoft Outlook 11.0 Object Library" is selected
(ticked). Click OK and leave the VBE window open.

3. (optional) Install ExpressClickYes from
http://www.contextmagic.com/express-clickyes/ if you have a lot of emails to
send and can't afford to wait 5'' and click "Yes" once for every single email
that will be sent.

4. Create a new Excel spreadsheet.
+ On the first column use "email" as the column header and enter all
email addresses you wish to send messages to.
+ On the second column use "file" as the column header and enter the
full path to the file that should be sent to the particular address. The full
path should be of the form "C:\Documents and Settings\myusername\My
Documents\report.doc" or "http://full.path.org/filename.xls"
+ Save the file as "Directory Source.xls" and close it.

5. Start a new Word document. Start the mail merge wizard. (I assume you
know how to do plain mail merge - if not, please look for help in simpler
articles and once you've mastered plain mail merge - without attachments -
come back to this one).
+ For document type choose "Directory".
+ In the "recipients list" step, select the Excel file you just created,
"Directory Source.xls" as your data source.
+ Create a 2x1 table in the Word document (basically a single row split
in half).
+ Insert the merge field "email" in the first (left) cell of the table.
+ Insert the merge field "file" in the second (right) cell of the table.
+ Complete the mail merge wizard by selecting to merge "To new
document..." and confirming you want all records to be merged.

6. The result is a new Word document, which has a table with all of the
information you entered in the Excel spreadsheet "Directory Source.xls".
+ Save this file as Directory.doc and close it.

7. Open your Word document that you have setup for mail merge. This should
have all merge fields that you want, a proper connection to a data source
(usually an Excel spreadsheet or a SQL database), the text that ties it all
together, etc. This is a working mail merge document, to which we will append
the attachments functionality.
+ Start the mail merge wizard, selecting Document Type: "Letters"
+ For recipients list, use whatever data source you had setup before
worrying about attachments. This data source should have all information
necessary to fill in the merge fields of your Word file, but no attachment
information.
+ At the final step of the Wizard choose "Edit Individual Letters". This
will create a NEW document (yes, another one!) with all of your merged
messages one after the other.

8. With this document active (open & in the foreground), copy the Visual
Basic code from Doug's page
(http://word.mvps.org/faqs/mailmerge/MergeWithAttachments.htm) into a new
macro in the Visual Basic Editor you had open from step 1. Make sure that
Doug's code is the only thing in that window, no other comments, functions or
anything are required.

9. Save the macro and then run it through the Word menu Tools -> Macro ->
Macros

10. If you've done everything right, you should get a pop-up asking you for
a filename. Point it to the Word document you created and called
"Directory.doc" (the one with the big table of emails and file paths)

11. Activate ExpressClickYes of you want it to automatically approve all
outgoing emails.

12. You get another popup for the subject. Just type the subject your emails
should have.

13. Enjoy!

I've used this with Office 2003 and it works very well. Only limitation I
see is that emails get sent in plain text format, but I'm sure there is a way
around this. If someone knows how, I'd love to hear.

Hope this helps some people get less stuck...

-A
 
W

Wendy

Alexandros

I like the break down of the instructions you provided for this problem. I
however am working with MS Office 07 and the steps don't work the same. Can
you tell me how to do this in 07?
 
S

sgacek

Hello Alexandros.
Do you think these instructions would work with an Access database rather
than Excel? We have one set up and need to attach 3 docs to the main email.
I am willing to give it a go if you think it will work.
 
D

Doug Robbins - Word MVP

The method in the article Mail merge to email with attachments at:

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

will work with any data source.

BTW, Alexandros omitted to say that first you have to turn on the computer
and start Word. <G, D & R>
--
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
 
J

J Wilkie

I have followed all the instructions, have a directory file called Directory
Source.xls and Directory.doc and have started a new Word document with the
VBA (MS 2007) developer area open. I have got to the stage of having a Word
file open with my mail merged letters and on MS 2007 toolbar have created a
macro , copying the code given Doug Robbin's file. When I run the macro I
get the window, in which I link in Directory.doc and I get a pop up window
asking me for subject of emails - almost there - then I get a pop up window
saying 0 emails sent. Where am I going wrong? as I seem to be right at the
very end? I have checked email addresses (actually I managed to send emails
with no attachments yesterday - but today no emails at all. )
Any help appreciated.
 
D

DPJAEGER

J Wilkie -
I was in the exact same spot you are in, and I understand how frustrating
it can be to get so close only to have that “0 Messages Sent†box laughing at
you. It turns out that my problem was that I was not merging the document
that I wanted to email out into a new document before running the macro.
From the final letter you wish to merge, go to “Finish and Merge†under the
“Mailings†tab and select “Edit Individual Documents…†your mail merge
document will be exported to a new document that will have all the letters
with the correct information listed one right after the other (see Doug
Robbin’s last post on 1/5/2007 or steps 7 and 8 of alexandros.papadopoulos’s
outline). Then from THAT screen, run the macro and everything should work
out for you.

Good Luck
 
D

Doug Robbins - Word MVP

Yes, you must follow the instructions.

--
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, originally posted via msnews.microsoft.com
 

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