"Mail Merge to E-mail with Attachments" skipping files?
Hi Doug,
The table of attachments was created using a directory mail merge, with
email in the first column, a pdf file in the second and a word document in
the third column. When it didnt work the first time around I swapped some
of the files around ie word file with a pdf and that has made no difference.
The file is saved in a doc file.
I have also checked that the code is cycling through the table by adding a
MsgBox to read out the file name currently being handled and both files get
picket up but only the last one gets included in the mail.
For i = 2 To Maillist.Tables(1).Columns.Count
Set Datarange = Maillist.Tables(1).Cell(j, i).Range
' Line added below
MsgBox "Datarange is " & Datarange.Text
Datarange.End = Datarange.End - 1
oItem.Attachments.Add Trim(Datarange.Text), olByValue, 2
Next i
I am a bit stumped!
Thanks for your help.
|