Get FreeBusy information for a Room/resource

  • Thread starter TWFyaXVz
  • Start date Views 2,307
T

TWFyaXVz

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 = "RM@INFO.ARoom";

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("RM@INFO.ARoom");

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

appt.Recipients.ResolveAll();

appt.Display(false);

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

}

However the last line throuws a COM exception. Is it possible to retrieve

FreeBusy or appointment dates from a Resource?

Regards

Marius
 
D

Dmitry Streblechenko

What is that COM exception?

Dmitry Streblechenko (MVP)

-

"Marius" <Marius> wrote in message

news:181E91AD-F02B-4A83-BD81-CCD14AFF6D6C@microsoft.com...
> 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 = "RM@INFO.ARoom";
> 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("RM@INFO.ARoom");

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

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

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

> }

> However the last line throuws a COM exception. Is it possible to retrieve
> FreeBusy or appointment dates from a Resource?

> Regards
> Marius
 

Similar threads


Top