A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

“Mail Merge to E-mail with Attachments” skipping files?



 
 
Thread Tools Display Modes
  #1  
Old November 26th, 2008, 04:46 AM posted to microsoft.public.word.mailmerge.fields
Marcus
external usenet poster
 
Posts: 148
Default “Mail Merge to E-mail with Attachments” skipping files?

I am having trouble with the Mail Merge to E-mail with Attachments VB Script
written by Doug Robbins located he

http://word.mvps.org/FAQs/MailMerge/...ttachments.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.

  #2  
Old November 26th, 2008, 05:49 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default "Mail Merge to E-mail with Attachments" skipping files?

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" wrote in message
...
I am having trouble with the Mail Merge to E-mail with Attachments VB
Script
written by Doug Robbins located he

http://word.mvps.org/FAQs/MailMerge/...ttachments.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.



  #3  
Old November 26th, 2008, 06:10 AM posted to microsoft.public.word.mailmerge.fields
Marcus
external usenet poster
 
Posts: 148
Default "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 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.

  #4  
Old November 26th, 2008, 06:59 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default "Mail Merge to E-mail with Attachments" skipping files?

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" wrote in message
...
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.



  #5  
Old January 14th, 2009, 10:19 AM posted to microsoft.public.word.mailmerge.fields
Kaffee
external usenet poster
 
Posts: 1
Default "Mail Merge to E-mail with Attachments" skipping files?

Hi Doug,

I got the same problem with Marcus, I have about 7xx emails but only the
first 150 email is with attachments and the others do not have any
attachment. But within the 150 emails with attachment, part of them with the
correct names merged into the email.

I am sure the path of the attachments are correct since I just do the copy
and paste to all the records.

Please help.
"Doug Robbins - Word MVP" wrote:

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" wrote in message
...
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.




  #6  
Old January 14th, 2009, 07:42 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default "Mail Merge to E-mail with Attachments" skipping files?

If it works for some of them and not for all of them, then there must be a
problem with the path\filenames for the records that do not get the files
attached.

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

"Kaffee" wrote in message
...
Hi Doug,

I got the same problem with Marcus, I have about 7xx emails but only the
first 150 email is with attachments and the others do not have any
attachment. But within the 150 emails with attachment, part of them with
the
correct names merged into the email.

I am sure the path of the attachments are correct since I just do the copy
and paste to all the records.

Please help.
"Doug Robbins - Word MVP" wrote:

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" wrote in message
...
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.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.