Memory with MailItem.Send

  • Thread starter Thread starter Nathan
  • Start date Start date
N

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.
 
Back
Top