Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
mail merge with attachments
Hello,
I have read previous threads and have successfully implemented the email with attachments VBA code. However I want to extend this to include the CC operator. My directory contains the following headings: Email | CC | Attachment1 |.... I need the code to also include the corresponding line value in the CC column. Any help you can give would be great. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
mail merge with attachments
Modify the code in the macro as follows:
With oItem .Subject = mysubject .Body = ActiveDocument.Content Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range Datarange.End = Datarange.End - 1 .To = Datarange Set Datarange = Maillist.Tables(1).Cell(Counter, 2).Range Datarange.End = Datarange.End - 1 .CC = Datarange For i = 3 To Maillist.Tables(1).Columns.Count Set Datarange = Maillist.Tables(1).Cell(Counter, i).Range Datarange.End = Datarange.End - 1 .Attachments.Add Trim(Datarange.Text), olByValue, 1 Next i .Send End With -- 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 "Twisty1980" wrote in message ... Hello, I have read previous threads and have successfully implemented the email with attachments VBA code. However I want to extend this to include the CC operator. My directory contains the following headings: Email | CC | Attachment1 |.... I need the code to also include the corresponding line value in the CC column. Any help you can give would be great. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
mail merge with attachments
you are a genius thank you very much.
Just saved me 2 days of work Tristan "Doug Robbins - Word MVP" wrote: Modify the code in the macro as follows: With oItem .Subject = mysubject .Body = ActiveDocument.Content Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range Datarange.End = Datarange.End - 1 .To = Datarange Set Datarange = Maillist.Tables(1).Cell(Counter, 2).Range Datarange.End = Datarange.End - 1 .CC = Datarange For i = 3 To Maillist.Tables(1).Columns.Count Set Datarange = Maillist.Tables(1).Cell(Counter, i).Range Datarange.End = Datarange.End - 1 .Attachments.Add Trim(Datarange.Text), olByValue, 1 Next i .Send End With -- 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 "Twisty1980" wrote in message ... Hello, I have read previous threads and have successfully implemented the email with attachments VBA code. However I want to extend this to include the CC operator. My directory contains the following headings: Email | CC | Attachment1 |.... I need the code to also include the corresponding line value in the CC column. Any help you can give would be great. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail Merge with Attachments | Microsoft Word Help | |||
Attachments when using mail merge | Mailmerge | |||
Mail Merge with attachments | Microsoft Word Help | |||
Mail Merge with attachments | Mailmerge | |||
Mail Merge with Attachments | Mailmerge |