Get FreeBusy for a resource

M

Marius

Hi I am trying to get FreeBusy for a resource, is this possible?

I tried to use:

private void SetRecipientTypeForAppt()
{

Outlook.Application oApp = new
Microsoft.Office.Interop.Outlook.Application();
Outlook.AppointmentItem appt =
oApp.CreateItem(Outlook.OlItemType.olAppointmentItem) as
Outlook.AppointmentItem;

appt.Subject = "Customer Review";
appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
appt.Location = "(e-mail address removed)";
appt.Start = DateTime.Parse("5/23/2009 10:00 AM");
appt.End = DateTime.Parse("5/23/2009 11:00 AM");

Outlook.Recipient recipRequired = appt.Recipients.Add("Bob Smith");

recipRequired.Type = (int)Outlook.OlMeetingRecipientType.olRequired;


Outlook.Recipient recipOptional = appt.Recipients.Add("Tom Jones");

recipOptional.Type = (int)Outlook.OlMeetingRecipientType.olOptional;

Outlook.Recipient recipConf = appt.Recipients.Add("(e-mail address removed)");

recipConf.Type = (int)Outlook.OlMeetingRecipientType.olResource;

appt.Recipients.ResolveAll();
appt.Display(false);

MessageBox.Show(recipConf.FreeBusy(DateTime.Now, 15, false));

}

However this throuws a COM exception on the last line, seems like a resource
"recipient" does not have FreeBusy information. Any thoughts will be greatly
appreciated.
 

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