Memory with MailItem.Send

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top