"Your server administrator has limited the number of items you can open simultaneously. Try closing messages you have opened or removing attachments and images from unsent messages you are composing."

Add-in Express™ Support Service
That's what is more important than anything else

"Your server administrator has limited the number of items you can open simultaneously. Try closing messages you have opened or removing attachments and images from unsent messages you are composing."
 
Steve Obarowski




Posts: 16
Joined: 2017-01-24
Stemming from my previous question, I now loop through all folders to attach event handlers. When Outlook is not in cached mode, I get the error

"Your server administrator has limited the number of items you can open simultaneously. Try closing messages you have opened or removing attachments and images from unsent messages you are composing.
at Outlook.FoldersClass.get_Count()"

I am doing a Marshal.ReleaseComObject on every folder as I go through.

Here is the function I am calling:
private void AttachToAllFolders(MAPIFolder folder)
{
if (folder != null)
{
AddOutlookFolderItemsEventsForDrag(folder.EntryID, folder.StoreID);
AddOutlookFolderEvents(folder.EntryID, folder.StoreID);
for (int j = 1; j <= folder.Folders.Count; j++)
{
MAPIFolder sysFolder = folder.Folders.Item(j);
if (sysFolder.Name.Equals("Deleted Items"))
{
continue;
}
else
{
AttachToAllFolders(sysFolder);
}
}
Marshal.ReleaseComObject(folder);
}
}

If Outlook is in cache mode, everything works great.

Any thoughts you have would be greatly appreciated.
Posted 08 Jun, 2017 10:29:52 Top
Andrei Smolin


Add-in Express team


Posts: 14129
Joined: 2006-05-11
Hello Steve,

You need to release COM objects. Check section Releasing COM Objects, see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2017 03:47:13 Top