mail merge with attachments

T

Twisty1980

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

Doug Robbins - Word MVP

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
 

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