Is there any restrictions to the number of Attachment i can add?

Status
Not open for further replies.
J

Junior728

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\Freight Guidelines for

Suppliers\Supplier Memo.pdf")

> Attachments.Add

("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight Guidelines for

Suppliers\ Routing Guide (Rev 10).pdf")

> Attachments.Add

("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight 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
 
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.

"Junior728" <Junior728> wrote in message

news:4980701C-E2FE-415C-A8FF-DD5A42CA2FC4@microsoft.com...
> 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\Freight Guidelines for
> Suppliers\Supplier Memo.pdf")
> .Attachments.Add
> ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight Guidelines for
> Suppliers\ Routing Guide (Rev 10).pdf")
> .Attachments.Add
> ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight 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

>
 
What is the exact error?

Dmitry Streblechenko (MVP)

-

"Junior728" <Junior728> wrote in message

news:4980701C-E2FE-415C-A8FF-DD5A42CA2FC4@microsoft.com...
> 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\Freight Guidelines for
> Suppliers\Supplier Memo.pdf")
> .Attachments.Add
> ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight Guidelines for
> Suppliers\ Routing Guide (Rev 10).pdf")
> .Attachments.Add
> ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight 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

>
 
Re: 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)
>

>

>

> -
> "Junior728" <Junior728> wrote in message
> news:4980701C-E2FE-415C-A8FF-DD5A42CA2FC4@microsoft.com...
> > 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\Freight Guidelines for
> > Suppliers\Supplier Memo.pdf")
> > .Attachments.Add
> > ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight Guidelines for
> > Suppliers\ Routing Guide (Rev 10).pdf")
> > .Attachments.Add
> > ("S:\SiteData\SIN2\EMS\Purchasing\Pur\JMatls\Freight 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
> >


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Diane Poremsky This operation has been cancelled due to restrictions Using Outlook 0
O Add Day Number of the year for 2023-2033 Outlook VBA and Custom Forms 5
W The number one raw material applied in producing the duvet, is clean and slight to your pores Using Outlook 0
T Increasing the number of items that appear on the Categories list Using Outlook 2
TomHuckstep Outlook 2016 Limit the number of days syncing from Google Calendar Using Outlook 1
F How to create phone number as links in notes of Contacts Using Outlook 2
I Outlook 2016 Outlook Requesting Phone Number??? Using Outlook 1
C Calculating Week Number into a TextBox Outlook VBA and Custom Forms 0
J VBA Outlook : Subject line : Cut and Paste name to heading , number to very end of the body of Email Outlook VBA and Custom Forms 1
O How to display number of items per .pst file Using Outlook 7
S Show Total Number Of Items Not Displaying Using Outlook 9
I Identify Number of email messages opened Outlook VBA and Custom Forms 7
J Saving attachments from specific sender (phone number) to specific folder on hard drive Using Outlook 3
J How to Fix “Encounter a large number of conflict items in Exchange OST file” Using Outlook 2
S Subject add ticket number from URL query Outlook VBA and Custom Forms 2
Diane Poremsky Add a file number or keyword to the subject line of messages Using Outlook 0
K Append subjectline based on number Using Outlook 4
B ...administrator has limited the number of items you can open simultaneously Outlook VBA and Custom Forms 7
snhnic Macro that does not overwrite but add a number Outlook VBA and Custom Forms 1
L Outlook 2007 Fix Phone Number Using Outlook 19
A Calendar List View Showing Week Number Using Outlook 1
neobite Maximum number of Exchange accounts in an Outlook profile Using Outlook 4
P Country name no longer shows in Phone number popup? Using Outlook 5
Edaniels Adding Week Number on Calender Using Outlook 2
P Outlook 2013 Phone Number Format Using Outlook 0
E Outlook VBA to print attached Pdf to a fax printer and assign fax number Using Outlook 0
D Journal problem recording correct phone number Using Outlook 7
A Assign a unique number to every message I send Using Outlook 0
S Outlook - Reset the number of day-events Using Outlook 0
Z assign unique number email Using Outlook 8
M Automatically highlight unread mail in Favorites inbox(s) (Blue number) Using Outlook 1
D Journal to show Phone Number dialled. Using Outlook 3
B Llimit the number of people accepting one of the "pick a date" meeting Using Outlook 1
O BCM 2010 - Customize a field with a consecutive number? BCM (Business Contact Manager) 1
G Change length of phone number in contacts Using Outlook 5
R printing custom number of calendar days in weekly view format Using Outlook 1
J Ho do I hide the week number on the Calendar Printing Assistant template Using Outlook 4
S Persistent nuisance number Using Outlook 4
A Need method to rapidly correct telephone contact telephone number formatting Using Outlook 1
R NUMBER Format Using Outlook 0
M Mail in HTML format can't be sent if url or number is in the body Outlook 2010 Using Outlook 2
A How do I get Outlook to stop adding a "+1" in front of a telephone number that has an extension. Using Outlook 13
S Your server administrator has limited the number of items you can Outlook VBA and Custom Forms 5
G Outlood phone number default choices. BCM (Business Contact Manager) 1
S changing number sort BCM (Business Contact Manager) 1
D create auto number field in task form Outlook VBA and Custom Forms 4
A Need leading zero for month number is less than 10 Outlook VBA and Custom Forms 1
R Outlook Web App - calendar week number is incorrect Exchange Server Administration 6
S [O2007] -> How to search for a string in the body and get the line number? Outlook VBA and Custom Forms 1
M How do I get the version number of the Setup project? Outlook VBA and Custom Forms 1

Similar threads

Back
Top