A Microsoft Outlook email forum. Outlook Banter

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 » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 17th 09, 11:47 AM posted to microsoft.public.outlook.program_vba
Junior728
external usenet poster
 
Posts: 3
Default 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


Ads
  #2  
Old June 17th 09, 05:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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



  #3  
Old June 17th 09, 11:05 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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




  #4  
Old June 18th 09, 03:02 AM posted to microsoft.public.outlook.program_vba
Junior728
external usenet poster
 
Posts: 3
Default 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





 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook rules restrictions Zadig Galbaras Outlook - General Queries 15 May 8th 08 06:42 PM
Working with SMTP Restrictions TC Outlook - General Queries 1 February 1st 07 11:04 PM
Mailbox restrictions not working? Chris Weber Outlook - General Queries 0 May 2nd 06 08:24 PM
Autoaccept restrictions by user Boe Outlook - Calandaring 1 April 25th 06 07:23 PM
Browsing Restrictions Cgriffin Outlook Express 1 February 19th 06 12:20 AM


All times are GMT +1. The time now is 08:14 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-2025 Outlook Banter.
The comments are property of their posters.