Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Specific Email Merge w/ Specific Attachements
Can someone explain if this is possible and lead me somewhere as to how it
can be done... I have a CSV file with a number of fields in it, including email address. I want to merge the file with a word document and send each specific document as the body of the email to the specific email address it is associated with. Additionally, I want to send an attachment to every email address, but which attached file gets sent is also dependent on the specific email address. Is this possible? Thanks! |
#2
|
|||
|
|||
See the article "Mail Merge to E-mail with Attachments" at
http://word.mvps.org/FAQs/MailMerge/...ttachments.htm -- 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 "Mark B" wrote in message ... Can someone explain if this is possible and lead me somewhere as to how it can be done... I have a CSV file with a number of fields in it, including email address. I want to merge the file with a word document and send each specific document as the body of the email to the specific email address it is associated with. Additionally, I want to send an attachment to every email address, but which attached file gets sent is also dependent on the specific email address. Is this possible? Thanks! |
#3
|
|||
|
|||
1) "set a reference to the Microsoft Office Outlook Object Library. You do
this from within the Visual Basic Editor" How do I get into VBE? 2) "create a separate Catalogue" What is a catalogue? |
#4
|
|||
|
|||
Doung, Seriously, where can I get a layman's explanation of this?
"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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." |
#5
|
|||
|
|||
You can get into VBE using Word Tools|Macro|Visual Basic Editor. (However,
as I understand it, not all versions of Word/Office install the Macro Editor, and the option to use it may not have been selected during Setup.) In Word mailmerge, you can create a "Directory" as output. "Catalogue" is the term used in older versions of Word for the same thing. Peter Jamieson "Mark B" wrote in message ... 1) "set a reference to the Microsoft Office Outlook Object Library. You do this from within the Visual Basic Editor" How do I get into VBE? 2) "create a separate Catalogue" What is a catalogue? |
#6
|
|||
|
|||
What version of Word are you using? If it is Word XP or later, don't blame
me for the Mailmerge wizard. I would suggest that you select Toolbars from the View menu and check the Mailmerge toolbar item so that the Mailmerge toolbar is displayed. The first button on the left of that toolbar is used to select the type of mailmerge that you want to create. The article goes into some detail about how to set up the mailmerge main document. I don't think I can make it much clearer, even for a layman. -- 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 "Mark B" wrote in message ... Doung, Seriously, where can I get a layman's explanation of this? "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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." |
#7
|
|||
|
|||
In Word mailmerge, you can create a "Directory" as output. "Catalogue" is
the term used in older versions of Word for the same thing. Thank you Peter! Maybe you can explain the rest of this to me... "You will need to create a separate Directory-type mail merge main document" I am using 2003, so I assume this is how the first sentence should read. Is there some documentation as to what a Directory-type mail merge main document actually is? "... 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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." If I am understanding this correctly, even though doug says he can't explain thsi any better, the directory-type thing above creates a table with the email address and the specific attachment. If so, my question is, can't I just have this ready to go in excel? Or am I totally confused... |
#8
|
|||
|
|||
Doug, I am not blaming you for anything other than a poorly written
explanation of the process. Do you really think that sentence reads well? "Doug Robbins" wrote: What version of Word are you using? If it is Word XP or later, don't blame me for the Mailmerge wizard. I would suggest that you select Toolbars from the View menu and check the Mailmerge toolbar item so that the Mailmerge toolbar is displayed. The first button on the left of that toolbar is used to select the type of mailmerge that you want to create. The article goes into some detail about how to set up the mailmerge main document. I don't think I can make it much clearer, even for a layman. -- 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 "Mark B" wrote in message ... Doung, Seriously, where can I get a layman's explanation of this? "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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." |
#9
|
|||
|
|||
I am using 2003, so I assume this is how the first sentence should read.
Is there some documentation as to what a Directory-type mail merge main document actually is? If you look at Word Help, Table of Contents, Mass Mailings, you may find an item titled "Word mail merge: A walk through the process" which is a link to a page somewhere on the Office web site. I say "you may find" only because these days the contents of Word Help are updated dynamically from the web so I can't be sure this particular link will show up on your system. There are several types of Mail Merge Main Document, e.g. Labels, Letter, Directory and a few others. The essential differences between a Letter merge and a Directory merge are as follows: In a typical Letter merge, Word takes each record in the data source and generates a outputs one letter for each record in the data source, i.e. if the "destination" of the merge is a printer, Word starts each new letter at the top of a new sheet of paper. The destination of a Letter merge can be a printer, e-mail (and, in theory, fax), or a new document. If the destination is e-mail or fax, each letter is sent to a single recipient. If the destination is a new document, Word generates a single document with one Word Section for each record in the data source. In a Directory merge, Word does not start on a new page/section for each record in the data source. If, for example, the mail merge main document has five lines of text and fields, Word will output 5 lines for record 1 in the data source, followed immediately by five lines for record 2, etc. If the mail merge main document contains a single table row, Word will output a table containing one row for each record in the data source. The only destination you can successfully specify for a directory merge is a new document. If I am understanding this correctly, even though doug says he can't explain thsi any better, the directory-type thing above creates a table with the email address and the specific attachment. If so, my question is, can't I just have this ready to go in excel? Well, you could have it in Excel, but then the macro code in the referenced article would have to be different because currently it relies on the list of attachments being in a Word table. If the list were in an Excel document, the code would need to be substantially different. Or am I totally confused... Maybe :-) The trouble is that anything I say is quite likely to compound your confusion as it is difficult to explain some of this stuff without lapsing into technical jargon Also, I didn't write the article, so cannot be sure I have understood the authors' reasons for their approach. But here goes... 1. The objective is to be able to send personalised e-mails with attachments to a number of recipients. This is not possible "out of the box" using Word so the authors of the article have tried to work out a simple way to do it using a combination of merges and macros. 2. The essence of the process is as follows a. you have a Letter type mail merge main document (see above) used to generate the personalised main body for each e-mail. This needs to be attached to a mail merge data source with one record for each e-mail recipient. Let's call this data source "LetterData". LetterData needs to contain all the data used in the personalised body of the e-mail. Logically speaking, it does not need to contain the names of the attachments for each recipient, or even the recipient's e-mail address (although I suspect it would at least contain the address wherever the data came from) . But let's assume that LetterData does contain both of those things. b. you open your mail merge main document and perform the merge, setting the destination to be a new document. Let's call this document "Letters". "Letters" will be a single new document containing one Word section for each recipient. c. At this point you use the macro provided in the article. In effect, this takes the first section of "Letters" and copies it to the body of a new e-mail message, addressed to the first recipient in the data source. It determines which files should be sent to this recipient and attaches them, then sends the message. This process is repeated for each section in "Letters", i.e. for each recipient. 3. In order to do this, the macro could get all the necessary data from LetterData. But how does it do that? The trouble is that the code needed depends on the type of data source. So for example, if LetterData is a Word document, the obvious method is to use Word Automation. If LetterData is an Excel workbook, Word Automation is no good - you could try Excel Automation. If LetterData is an Access table, you could use a number of methods, including ADO, DAO etc. But they are all different. In fact the only /easy/ way to generalise this code would be to turn "Letters" into a Mail Merge Main Document, attach LetterData to it as the data source, and use the methods of the Mailmerge.DataSource object to iterate through the data without actually performing a merge. Unfortunately, even that is harder than it sounds because programmatically opening an arbitrary data source is a non-trivial exercise. For some types of data source it's easy, but for others it's quite difficult. 4. So what is the technical solution? The user could have their attachment data in any format. By using a separate catalogue merge, the user can take their attachment data and generate a file in a known format (a table within a Word document). With any luck, it should be fairly easy for the user to set this up manually in the usual way. The code in the article only has to deal with that one format of data, and the process is also arguably simpler because Word VBA knows all bout Word objects and no external objects or code libraries are needed. Peter Jamieson "Mark B" wrote in message ... In Word mailmerge, you can create a "Directory" as output. "Catalogue" is the term used in older versions of Word for the same thing. Thank you Peter! Maybe you can explain the rest of this to me... "You will need to create a separate Directory-type mail merge main document" I am using 2003, so I assume this is how the first sentence should read. Is there some documentation as to what a Directory-type mail merge main document actually is? "... 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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." If I am understanding this correctly, even though doug says he can't explain thsi any better, the directory-type thing above creates a table with the email address and the specific attachment. If so, my question is, can't I just have this ready to go in excel? Or am I totally confused... |
#10
|
|||
|
|||
So how would you write so that it might be understood by a computer
professional. The amateurs don't seem to have a problem with it as it is. -- 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 "Mark B" wrote in message ... Doug, I am not blaming you for anything other than a poorly written explanation of the process. Do you really think that sentence reads well? "Doug Robbins" wrote: What version of Word are you using? If it is Word XP or later, don't blame me for the Mailmerge wizard. I would suggest that you select Toolbars from the View menu and check the Mailmerge toolbar item so that the Mailmerge toolbar is displayed. The first button on the left of that toolbar is used to select the type of mailmerge that you want to create. The article goes into some detail about how to set up the mailmerge main document. I don't think I can make it much clearer, even for a layman. -- 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 "Mark B" wrote in message ... Doung, Seriously, where can I get a layman's explanation of this? "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\Filename of each attachment in the second and any subsequent columns, one attachment per cell." |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sending Mail Merge to Email to Multiple Recipients in the Same Mes | Mailmerge | |||
Problems when performing a HTML email merge using Word 2003 | Mailmerge | |||
How to attach a PDF file to a Mail Merge Email from Word? | Mailmerge | |||
Selecting email client to use with email merge | Mailmerge | |||
Using MAILMERGE fields within HYPERLINK fields for Merge to Email | Mailmerge |