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

Problem with saving a mail with a lot of recipients



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 6th 06, 04:23 PM posted to microsoft.public.outlook.program_vba
toni santa
external usenet poster
 
Posts: 3
Default Problem with saving a mail with a lot of recipients

Hi,
when saving a mail with a lot of recipients I receive an 'out of memory'
error. OL2003. Is this a bug of MAPI implemented by OL? See (nonsens)code
below to reproduce it.
best regards
Toni

Sub mailtest()
Dim myItem As MailItem
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
For i = 1 To 2300
Set myRecipient = myItem.Recipients.Add("[smtp:santaxf@dnetxxyyzz" &
i & ".com]")
Next
myItem.Display
myItem.SaveAs "c:\temp\test.msg", olMSG
End Sub


Ads
  #2  
Old December 6th 06, 04:27 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Problem with saving a mail with a lot of recipients

You might try running Recipients.ResolveAll before you try to save.

I can't imagine what the purpose of your approach is, though.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"toni santa" wrote in message ...
Hi,
when saving a mail with a lot of recipients I receive an 'out of memory'
error. OL2003. Is this a bug of MAPI implemented by OL? See (nonsens)code
below to reproduce it.
best regards
Toni

Sub mailtest()
Dim myItem As MailItem
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
For i = 1 To 2300
Set myRecipient = myItem.Recipients.Add("[smtp:santaxf@dnetxxyyzz" &
i & ".com]")
Next
myItem.Display
myItem.SaveAs "c:\temp\test.msg", olMSG
End Sub


  #3  
Old December 6th 06, 05:14 PM posted to microsoft.public.outlook.program_vba
toni santa
external usenet poster
 
Posts: 3
Default Problem with saving a mail with a lot of recipients

Hi Sue,
many thanks. But the ResolveAll doesn't resolve the problem.
The approach in the real world is that the email-addresses are taken from a
database and all the recipients receive a periodically information. After
sending the email, it is saved and in the database I create a link to the
saved email so still after some year I 'll know who received which mail.
The stupid VBA sample I created only to reproduce / show / explain the
problem.
best regards
Toni

"Sue Mosher [MVP-Outlook]" ha scritto nel messaggio
...
You might try running Recipients.ResolveAll before you try to save.

I can't imagine what the purpose of your approach is, though.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"toni santa" wrote in message
...
Hi,
when saving a mail with a lot of recipients I receive an 'out of memory'
error. OL2003. Is this a bug of MAPI implemented by OL? See (nonsens)code
below to reproduce it.
best regards
Toni

Sub mailtest()
Dim myItem As MailItem
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
For i = 1 To 2300
Set myRecipient = myItem.Recipients.Add("[smtp:santaxf@dnetxxyyzz"
&
i & ".com]")
Next
myItem.Display
myItem.SaveAs "c:\temp\test.msg", olMSG
End Sub




  #4  
Old December 6th 06, 05:20 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Problem with saving a mail with a lot of recipients

IMO, the real problem is that a single message with hundreds of recipients is not the best way to manage this email nor to track who received what mailing. A better approach would be to use the database as the data source for a Word mail merge to email and to track who received the mailing within the database itself.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"toni santa" wrote in message ...
Hi Sue,
many thanks. But the ResolveAll doesn't resolve the problem.
The approach in the real world is that the email-addresses are taken from a
database and all the recipients receive a periodically information. After
sending the email, it is saved and in the database I create a link to the
saved email so still after some year I 'll know who received which mail.
The stupid VBA sample I created only to reproduce / show / explain the
problem.
best regards
Toni

"Sue Mosher [MVP-Outlook]" ha scritto nel messaggio
...
You might try running Recipients.ResolveAll before you try to save.

I can't imagine what the purpose of your approach is, though.

"toni santa" wrote in message
...
Hi,
when saving a mail with a lot of recipients I receive an 'out of memory'
error. OL2003. Is this a bug of MAPI implemented by OL? See (nonsens)code
below to reproduce it.
best regards
Toni

Sub mailtest()
Dim myItem As MailItem
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
For i = 1 To 2300
Set myRecipient = myItem.Recipients.Add("[smtp:santaxf@dnetxxyyzz"
&
i & ".com]")
Next
myItem.Display
myItem.SaveAs "c:\temp\test.msg", olMSG
End Sub




  #5  
Old December 6th 06, 06:22 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Problem with saving a mail with a lot of recipients

Yes, a large number of recipients is definitely a problem in most MAPI
providers.
For the MSG files, things start breaking apart when you have more than
100-200 recipients
plug
Redemption (url below) saves MSG files with a large # of recipients just
fine by creating an MSG file (which is really an OLE storage file) in a
slightly different format, which is still perfetcly readable by Outlook in
Windows 2000 and above.
Try to replace the following line

myItem.SaveAs "c:\temp\test.msg", olMSG

with

set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = myItem
sItem.SaveAs "c:\temp\test.msg", olMSG

/plug

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"toni santa" wrote in message
...
Hi Sue,
many thanks. But the ResolveAll doesn't resolve the problem.
The approach in the real world is that the email-addresses are taken from
a database and all the recipients receive a periodically information.
After sending the email, it is saved and in the database I create a link
to the saved email so still after some year I 'll know who received which
mail.
The stupid VBA sample I created only to reproduce / show / explain the
problem.
best regards
Toni

"Sue Mosher [MVP-Outlook]" ha scritto nel
messaggio ...
You might try running Recipients.ResolveAll before you try to save.

I can't imagine what the purpose of your approach is, though.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"toni santa" wrote in message
...
Hi,
when saving a mail with a lot of recipients I receive an 'out of memory'
error. OL2003. Is this a bug of MAPI implemented by OL? See (nonsens)code
below to reproduce it.
best regards
Toni

Sub mailtest()
Dim myItem As MailItem
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.CreateItem(olMailItem)
For i = 1 To 2300
Set myRecipient = myItem.Recipients.Add("[smtp:santaxf@dnetxxyyzz"
&
i & ".com]")
Next
myItem.Display
myItem.SaveAs "c:\temp\test.msg", olMSG
End Sub






 




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
Problem with deleted Recipients reappearing saeongjeema via OfficeKB.com Outlook - Using Contacts 0 April 1st 06 02:37 PM
Problem saving contacts [email protected] Outlook - General Queries 1 March 13th 06 09:54 PM
Problem saving appiontments, just started, how do I get help? Sunkiss Outlook - Calandaring 2 March 6th 06 07:01 PM
A LOT of my e-mail has dissappeared. ionamic Outlook Express 5 February 24th 06 09:21 PM
Problem with saving .txt attachement norhaya Outlook and VBA 4 January 12th 06 10:20 AM


All times are GMT +1. The time now is 08:20 AM.


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.