Group:  Microsoft Word » microsoft.public.word.mailmerge.fields
Thread: hments”_skipping_files?

Geek News

hments”_skipping_files?
marcus 11/26/2008 4:46:01 AM
I am having trouble with the Mail Merge to E-mail with Attachments VB Script
written by Doug Robbins located here:

http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm

My problem is that when I run the macro only the final file in my table of
attachments gets included in the sent emails. At first I thought it was
likely to be a problem with either my file names or the file type so I mixed
them up in the table and the problem remains with the files in the last
column being picked up regardless of extension.

If any one has any idea on how to fix this I would appreciate your help.

Re: "Mail Merge to E-mail with Attachments" skipping files?
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 11/26/2008 5:49:07 AM
Can you provide some more information about your "table of attachments"

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

"marcus" <marcus[ at ]discussions.microsoft.com> wrote in message
news:9170F065-4FB9-4C12-8DBF-15AA1CEB909A[ at ]microsoft.com...
[Quoted Text]
>I am having trouble with the Mail Merge to E-mail with Attachments VB
>Script
> written by Doug Robbins located here:
>
> http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm
>
> My problem is that when I run the macro only the final file in my table of
> attachments gets included in the sent emails. At first I thought it was
> likely to be a problem with either my file names or the file type so I
> mixed
> them up in the table and the problem remains with the files in the last
> column being picked up regardless of extension.
>
> If any one has any idea on how to fix this I would appreciate your help.
>


Re: "Mail Merge to E-mail with Attachments" skipping files?
marcus 11/26/2008 6:10:01 AM
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 didn’t 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.

Re: "Mail Merge to E-mail with Attachments" skipping files?
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 11/26/2008 6:59:28 AM
Marcus,

Are you sure that the path\filenames of all of the attachments are one
hundred percent correct? 99.9999% is not good enough. Just one space in
the wrong place or one space too many in a path\filename with spaces will
cause the attachment to be ignored.

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

"marcus" <marcus[ at ]discussions.microsoft.com> wrote in message
news:8F8F5751-0F3B-47D8-81B9-8F4B49484D9F[ at ]microsoft.com...
[Quoted Text]
> 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 didn't 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.
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net