locked
How to use EWS to counter-propose a time or recurring schedule for a meeting? RRS feed

  • Question

  • Hi,
    I am using the EWS Managed API 1.1 to set up a pull subscription to room mailbox calendars.  The notifications I receive when calendar items are created (as a result of an Outlook user, the meeting organizer, scheduling the room in a meeting request) allow me to save the room's schedule to another scheduling system. 

    I have a requirement that users of the other scheduling system be allowed to make changes to the room's schedule.  When that happens, my system needs to send a 'propose new time' message back to the organizer, so the organizer can respond appropriately to keep all the meeting attendees' calendars synchronized.  How, using the API, could I send the new time proposal back to the meeting organizer?

    The user account used to log into EWS has full permissions to the room mailboxes, so I'd like to just bind to the appointment in the room's calendar, which I can do, and then do something like: appt.ProposeNewTime(...); 

    but nothing like that exists - even though the EWS intro http://msdn.microsoft.com/en-us/library/dd877045(v=exchg.140).aspx says, under Item Operations, Calendar Items: "Meeting attendees can accept, decline, and acknowledge the receipt of invitations and counter-propose a time or recurring schedule for a meeting." 

    What's missing?

    Tuesday, September 27, 2011 3:51 PM

All replies

  • I dont believe you can currently 'propose new time' directly using any of the EWS operations its something you can't also do using Outlook 2011 on Mac AFAIK which uses EWS to access the Exchange store. If you really needed to do this you could probably do it manually using the documentation from http://msdn.microsoft.com/en-us/library/cc425490%28v=exchg.80%29.aspx although this may also not work if it requires setting specific recipient collection properties which aren't accessible using EWS. eg PR_RECIPIENT_PROPOSED is recipient collection property that would need to be set on your response but this wouldn't be directly accessible using EWS.

    Cheers
    Glen

    Wednesday, September 28, 2011 3:43 AM
  • Glen,

    Thanks for the info.

    From what I can tell by the documentation then, is that i need to set some specific additional properties into the MeetingResponse.  The problem is there appears to be no way to access the MeetingResponse object which appears to be embedded in the various message objects returned by the appointment item's (or MeetingRequest's)  CreateAcceptMessage, CreateDeclineMessage, CreateCancelMeetingMessage methods.  So, i'd expect to do something like the following:

    DeclineMeetingInvitationMessage dmim = appt.CreateDeclineMessage();

    // set the specific additional properties into the meeting response to make it a propose new time message

    dmim.SetExtendedProperty(...);

    or

    dmim.MeetingResponse.SetExtendedProperty(...);

    dmim.Send();

    How does one set properties on the MeetingResponse object?

    Thanks,

    Kevin
    Friday, September 30, 2011 3:13 PM
  • As far as the Meeting Response is concerned its not embedded in anything its actually the message object itself so if you want to set Extended properties on the response its  

    dmim.SetExtendedProperty()

    From the looks you need to use a Tentative response eg the message class should be IPM.Schedule.Meeting.Resp.Tent

    I would suggest using a Mapi editor like Outlook Spy or MFC Mapi to look at the new time proposal message you send using Outlook and look at the properties that get set and what location they are set.

    Cheers
    Glen

    Monday, October 3, 2011 3:05 AM
  • Sorry, I had to spend some time on another project and am finally getting back to this one.

    Let me back up a bit: In the EWS Intro at http://msdn.microsoft.com/en-us/library/dd877045(v=exchg.140).aspx, under the Exchange Web Services Features -> Item Operations -> Calendar Items, the last sentence says "Meeting attendees can accept, decline, and acknowledge the receipt of invitations and counter-propose a time or recurring schedule for a meeting."

    What I'd like to know is, how does one counter-propose a time or recurring schedule for a meeting?  I have searched for hours for an example of how to do this and have seen none.  The references in the earlier replies suggest a requirement of setting extended properties on the meeting response, but there seems to be no way to do that with the api (in my last post, the SetExtendedProperty method does not exist on the DeclineMeetingInvitationMessage). 

    What gives? Is this an error in the EWS Intro (it is not possible to counter-propose a time or recurring schedule)?  If it is possible, could someone provide an example of how to do it?


    Kevin

    • Edited by kjob Wednesday, October 12, 2011 6:13 PM
    Wednesday, October 12, 2011 4:53 PM
  • There is no direct support within EWS to do this so the Intro is wrong there isn't feature parity yet between EWS and Outlook/Mapi (although its improved greatly) so with this type of thing you need to either accept the functionality as is or try to work around it. To create a work around you will generally need to use a Mapi editor hence my suggestion the following seems to work for me okay.

                FindItemsResults<Item> fiResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(1));
                MeetingRequest mr = MeetingRequest.Bind(service, fiResults.Items[0].Id);
                AcceptMeetingInvitationMessage TentAcep = mr.CreateAcceptMessage(true);
                CalendarActionResults crResults = TentAcep.Save();
                ExtendedPropertyDefinition ApptCounterProposalStartTime = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8250, MapiPropertyType.SystemTime);
                ExtendedPropertyDefinition ApptCounterProposalEndTime = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8251, MapiPropertyType.SystemTime);
                ExtendedPropertyDefinition ApptCounterProposal = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8257, MapiPropertyType.Boolean);
                ExtendedPropertyDefinition ApptCounterProposalDuration = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8256, MapiPropertyType.Integer);
                crResults.MeetingResponse.SetExtendedProperty(ApptCounterProposalStartTime,DateTime.Now.AddDays(3));
                crResults.MeetingResponse.SetExtendedProperty(ApptCounterProposalEndTime, DateTime.Now.AddDays(3).AddHours(1));
                crResults.MeetingResponse.SetExtendedProperty(ApptCounterProposal, true);
                crResults.MeetingResponse.SetExtendedProperty(ApptCounterProposalDuration, 60);
                crResults.MeetingResponse.Send();
    

     

    The important thing is your not declining it your tentatively accepting it and you need to save it to drafts first to be able to set the extended properties.


    Cheers
    Glen

    Thursday, October 13, 2011 2:51 AM