View Single Post
  #5  
Old June 2nd 08, 02:41 PM posted to microsoft.public.outlook.program_vba
Rasmus Wätjen
external usenet poster
 
Posts: 7
Default Opening many shared calendars fails

I am using Delphi, so no garbage collection.
I am pretty sure that all variables are now set to Unassigned after every
calendar read, but the problem prevails.

Is there a way to remove a calendar from the "People's calendars" list in
Outlook?
I wonder why the other peoples calendar's are added to that list, when our
program reads the calendars using the object model. But maybe if the program
could remove the entries from that list after Outlook has added them, we
would be able to work around the problem.

Rasmus

"Dmitry Streblechenko" wrote in message
...
You need to release *all* the variables that point to the objects from
that mailbox (calendaritems, calendarfolder).
Move the code that opens and process a particular mailbox to a separate
sub - this way all local variables will be automatically released when the
sub exits.
If you are using .Net, GC.Collect would also be a good idea.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Rasmus Wätjen" -also-remove-this wrote
in message ...
The calendar information is needed in a telephone switchboard
application. - The user has a list of all coworkers where their daily
schedule is shown.

The calendars are read similar to this:
outlook = GetActiveOleObject('outlook.application');
namespace = outlook.GetNameSpace('MAPI');
while more contacts do
contact = namespace.CreateRecipient(otherusersalias);
calendarfolder = namespace.GetSharedDefaultFolder(contact,
olFolderCalendar);
calendaritems = calendarfolder.Items;
calendaritems.Sort('[Start]');
calendaritems.IncludeRecurrences = true;
restriction = '[Start] = midnighttoday and [End] = midnightyesterday';

while more items do
// read calendar times
done;
calendarfolder = Unassigned;
done;

I'm assuming that the final Unassigned assignment will close the folders,
and remove references?

Is there something missing, or should it be done differently?

Thank you.

Best regards,
Rasmus



"Dmitry Streblechenko" wrote in message
...
Why do you need to *simultaneously* open that many folders?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Rasmus Wätjen" -also-remove-this wrote
in message ...
Hi.
We are experiencing that when a user opens more than about 70
calendars.
Outlook fails with the message like "Unable to display the folder. The
information
store could not be opened".

Actually we found the problem because we have an app which reads all
calendars (using the COM interface to Outlook) and it fails when it
reaches
about 70. So we reproduced the problem by manually doing the same
thing. For
some reason the COM interface adds the calendar folders in the
"People's
Calendars" list in the left side of Outlook.

This is Outlook 2003 SP2.
Has anybody else seen this, or know a fix for it?

Best regards,
Rasmus






Ads