View Single Post
  #2  
Old June 25th 09, 05:24 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Memory with MailItem.Send



See if this helps:
http://www.vboffice.net/sample.html?...cmd=showite m

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Thu, 25 Jun 2009 07:35:02 -0700 schrieb Nathan:

I'm sending all the messages contained in a particular folder when Outlook
launches. This can be as many as 500 messages.

Watching Outlook.exe in task manager, as each message is sent, the Mem

Usage
slowly balloons from 24MB at start to 116MB just before crashing.

I have tried many different ways of setting my MailItem instances to
Nothing. I've also tried moving the sending code to a seperate Sub in the
hopes that garbage collection would release each MailItem from memory

after
being sent. Nothing has worked.

What is the correct way to use VBA to sent a MailItem and then release it
from memory before sending the next?

I can post my code if that'll help, but I'm hoping this situation has come
up before and there is a simple solution that I've been unable to find.

Thanks for any feedback.

Ads