checking outlook calendar

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

checking outlook calendar
 
serhat


Guest


hi,

is there a way to programmatically check outlook calendar to see if the given date range is empty(no appointments etc.) or not?

thanks in advance.
serhat.
Posted 13 Mar, 2005 12:28:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Serhat.

You can use the following code to check the existing items in calendar:

Outlook._AppointmentItem item;
Outlook._NameSpace _namespace = OutlookApp.GetNamespace("MAPI");
Outlook.MAPIFolder calendar = _namespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
for(int i=1; i<=calendar.Items.Count; i++)
{
item = calendar.Items.Item(i) as Outlook._AppointmentItem;
if (item != null)
{
MessageBox.Show("Start at " + item.Start.ToLongDateString() + " to " + item.End.ToLongDateString());
}
}
Posted 14 Mar, 2005 05:48:26 Top
Guest


Guest


thanks a lot sergey,

serhat.
Posted 17 Mar, 2005 15:34:41 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
You are welcome, Serhat
Posted 18 Mar, 2005 07:11:40 Top