View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Twisty1980 Twisty1980 is offline
external usenet poster
 
Posts: 2
Default 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.