![]() |
Is there any restrictions to the number of Attachment i can add?
Hi,
I am able to add the 3 attachment and automate it in vba. However, whenever, i added the 4th attachment, it will produce error. See my script below: Sub Freight() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail Dim cell As Range Dim strto As String Dim strbody As String Dim strbody1 As String LastRow = Cells(Rows.Count, "A").End(xlUp).Row strbody = " Pls do not reply to this email. This is an automated email generated to the intended parties.Thanks!" strbody1 = " Pls disregard Rev 9B from the previous email sent and use this Rev 10 effective date 29 June 09!" For Each cell In ThisWorkbook.Sheets("EmailAdd").Range("A2", Cells(LastRow, "A")) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) .BCC = strto .Subject = "Supplier Freight Arrangement Guidelines Rev 10 (Pls disregard Rev 9B)" .Body = strbody .Body = strbody1 .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Supplier Memo.pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\ Routing Guide (Rev 10).pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Worksheet in Routing Guide (Rev 10).pdf") .Send 'or use '.Display End With Set OutMail = Nothing Set OutApp = Nothing Workbooks("Freight Macro.xls").Close SaveChanges:=True Application.CommandBars("CreateOutlookMsg").Delete End Sub So i wish to know backend, is there any limitations of the no of attachment to be added in an email send out by using vba. If using buttons, it should not be a problem |
Is there any restrictions to the number of Attachment i can add?
I think the most attachments I ever added with code to a mail item was about
500, I'm not sure what the maximum limit would be. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Junior728" wrote in message ... Hi, I am able to add the 3 attachment and automate it in vba. However, whenever, i added the 4th attachment, it will produce error. See my script below: Sub Freight() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail Dim cell As Range Dim strto As String Dim strbody As String Dim strbody1 As String LastRow = Cells(Rows.Count, "A").End(xlUp).Row strbody = " Pls do not reply to this email. This is an automated email generated to the intended parties.Thanks!" strbody1 = " Pls disregard Rev 9B from the previous email sent and use this Rev 10 effective date 29 June 09!" For Each cell In ThisWorkbook.Sheets("EmailAdd").Range("A2", Cells(LastRow, "A")) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) .BCC = strto .Subject = "Supplier Freight Arrangement Guidelines Rev 10 (Pls disregard Rev 9B)" .Body = strbody .Body = strbody1 .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Supplier Memo.pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\ Routing Guide (Rev 10).pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Worksheet in Routing Guide (Rev 10).pdf") .Send 'or use '.Display End With Set OutMail = Nothing Set OutApp = Nothing Workbooks("Freight Macro.xls").Close SaveChanges:=True Application.CommandBars("CreateOutlookMsg").Delete End Sub So i wish to know backend, is there any limitations of the no of attachment to be added in an email send out by using vba. If using buttons, it should not be a problem |
Is there any restrictions to the number of Attachment i can add?
What is the exact error?
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Junior728" wrote in message ... Hi, I am able to add the 3 attachment and automate it in vba. However, whenever, i added the 4th attachment, it will produce error. See my script below: Sub Freight() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail Dim cell As Range Dim strto As String Dim strbody As String Dim strbody1 As String LastRow = Cells(Rows.Count, "A").End(xlUp).Row strbody = " Pls do not reply to this email. This is an automated email generated to the intended parties.Thanks!" strbody1 = " Pls disregard Rev 9B from the previous email sent and use this Rev 10 effective date 29 June 09!" For Each cell In ThisWorkbook.Sheets("EmailAdd").Range("A2", Cells(LastRow, "A")) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) .BCC = strto .Subject = "Supplier Freight Arrangement Guidelines Rev 10 (Pls disregard Rev 9B)" .Body = strbody .Body = strbody1 .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Supplier Memo.pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\ Routing Guide (Rev 10).pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Worksheet in Routing Guide (Rev 10).pdf") .Send 'or use '.Display End With Set OutMail = Nothing Set OutApp = Nothing Workbooks("Freight Macro.xls").Close SaveChanges:=True Application.CommandBars("CreateOutlookMsg").Delete End Sub So i wish to know backend, is there any limitations of the no of attachment to be added in an email send out by using vba. If using buttons, it should not be a problem |
Is there any restrictions to the number of Attachment i can ad
Hi,
I think there is some other things that causes the error. I did not save the error. But now i have retry again, and it works. thanks for the advice anyway. "Dmitry Streblechenko" wrote: What is the exact error? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Junior728" wrote in message ... Hi, I am able to add the 3 attachment and automate it in vba. However, whenever, i added the 4th attachment, it will produce error. See my script below: Sub Freight() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail Dim cell As Range Dim strto As String Dim strbody As String Dim strbody1 As String LastRow = Cells(Rows.Count, "A").End(xlUp).Row strbody = " Pls do not reply to this email. This is an automated email generated to the intended parties.Thanks!" strbody1 = " Pls disregard Rev 9B from the previous email sent and use this Rev 10 effective date 29 June 09!" For Each cell In ThisWorkbook.Sheets("EmailAdd").Range("A2", Cells(LastRow, "A")) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) .BCC = strto .Subject = "Supplier Freight Arrangement Guidelines Rev 10 (Pls disregard Rev 9B)" .Body = strbody .Body = strbody1 .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Supplier Memo.pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\ Routing Guide (Rev 10).pdf") .Attachments.Add ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freig ht Guidelines for Suppliers\Worksheet in Routing Guide (Rev 10).pdf") .Send 'or use '.Display End With Set OutMail = Nothing Set OutApp = Nothing Workbooks("Freight Macro.xls").Close SaveChanges:=True Application.CommandBars("CreateOutlookMsg").Delete End Sub So i wish to know backend, is there any limitations of the no of attachment to be added in an email send out by using vba. If using buttons, it should not be a problem |
All times are GMT +1. The time now is 06:09 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com