Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Exchange 250 open objMessage limit

Geek News

Exchange 250 open objMessage limit
bevan.johnson[ at ]rawlinson-hunter.com 4/21/2006 12:00:03 PM
I have read about this problem all over the forums, but have not come
across any answers yet.

I am creating MailItem objects within a VSTO C# Outlook add-in,
specifically in the SelectionChange event. This is to allow some
interigation of the selected mailItem. The problem I am facing is that
every time the event fires and a MailItem object is created, the "Open
Messages" count for that user increases by 1 on exchange. Fair enough,
but I cannot get the count to decrease when I move to the next
mailitem. I have tried:

Marshal.ReleaseComObject(myMail)
myMail.Close("with appropriate switch")
myMail = null

None of these seem to destroy the object and decrease the count. If I
cannot solve this problem, my whole project dissappears down the
plughole and I will be forced to buy "Off the shelf" Arrrghh.

Please help me, and thanks in advance.

Bev.

Re: Exchange 250 open objMessage limit
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 4/21/2006 1:07:11 PM
Can you change the limit on the server? It's a registry entry.

If not, make sure you don't use multiple dot operators but assign everything
explicitly to objects where needed. Release all those. Call the garbage
collector and wait for it to complete. Make sure you don't have any
persistent references to anything.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<bevan.johnson[ at ]rawlinson-hunter.com> wrote in message
news:1145620803.664157.74310[ at ]z34g2000cwc.googlegroups.com...
[Quoted Text]
>I have read about this problem all over the forums, but have not come
> across any answers yet.
>
> I am creating MailItem objects within a VSTO C# Outlook add-in,
> specifically in the SelectionChange event. This is to allow some
> interigation of the selected mailItem. The problem I am facing is that
> every time the event fires and a MailItem object is created, the "Open
> Messages" count for that user increases by 1 on exchange. Fair enough,
> but I cannot get the count to decrease when I move to the next
> mailitem. I have tried:
>
> Marshal.ReleaseComObject(myMail)
> myMail.Close("with appropriate switch")
> myMail = null
>
> None of these seem to destroy the object and decrease the count. If I
> cannot solve this problem, my whole project dissappears down the
> plughole and I will be forced to buy "Off the shelf" Arrrghh.
>
> Please help me, and thanks in advance.
>
> Bev.
>

Re: Exchange 250 open objMessage limit
bevan.johnson[ at ]rawlinson-hunter.com 4/21/2006 3:04:19 PM
Ken,

Thanks for the blisteringly fast reply.

I forgot to mention that raising the limit was not an option. But that
is irellevent now as forcing the GC did the trick. So simple, yet these
things often ellude us.

You are a god amongst MVPs.

Thanks again,

Bev.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net