locked
Outlook - Propose New Time RRS feed

  • Question

  • Hi,

    Does anyone know how to propose a new meeting time in a VSTO addin?

    I have tried changing the start and end time on the AppointmentItem and then calling Respond and sending the returned MeetingItem. However all this does is send the response (currently setting to tentative) to the Organizer, not a new time proposal.

    I need this to work in 2003 and 2010. (Currently testing in 2003).

    Thanks

    Paul

    Friday, February 7, 2014 9:19 AM

Answers

  • Hi Ken,

    I'll work around the problem now that I know it's not possible.

    Thanks for looking at this both of you.

    Paul

    Monday, February 10, 2014 4:30 PM

All replies

  • Hello Paul,

    You need to use the Respond method passing the olMeetingTentative value. For example:

    Sub AcceptMeeting() Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.Folder Dim myMtgReq As Outlook.MeetingItem Dim myAppt As Outlook.AppointmentItem Dim myMtg As Outlook.MeetingItem Set myNameSpace = Application.GetNamespace("MAPI") Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox) Set myMtgReq = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Request'") If TypeName(myMtgReq) <> "Nothing" Then Set myAppt = myMtgReq.GetAssociatedAppointment(True)

    ' here you can make any modifications

    myAppt.Start = #9/24/2003 1:30:00 PM#

    Set myMtg = myAppt.Respond(olMeetingTentative, True, False)

    End If End Sub

    Here is what MSDN states for the Respond method:

    When you call the Respond method with the olMeetingTentative parameter, Outlook will create a new appointment item that duplicates the original appointment item. The new item will have a different Entry ID. Outlook will then remove the original item. You should no longer use the Entry ID of the original item, but instead call the EntryID property to obtain the Entry ID for the new item for any subsequent needs. This is to ensure that this appointment item will be properly synchronized on your calendar if more than one client computer accesses your calendar but may be offline using the cache mode occasionally.



    Friday, February 7, 2014 10:13 AM
  • Hi,

    Thanks for your reply, however this does not seem to do what I need.

    I need to be able to take an Appointment object (pre-exisiting in the calendar) and propose a new time.

    I can send a tentative response but cannot send a propose new time response.

    I have tried:

    1) changing the start time on the original appointment and sending a tentative response.

    2) calling respond on the original appointment then calling GetAssociatedAppointment(true) on the returned MeetingItem and changing the Start on that Appointment Item and then sending the MeetingItem.

    Plus many variations.

    Any help would be great.

    Thanks Paul

    Friday, February 7, 2014 12:23 PM
  • Get the MeetingItem and change the time to your proposed new time. Change the subject if you want to describe the change. Use GetAssociatedAppointment() and then call the Respond() method of the AppointmentItem.

    See if that works.


    Ken Slovak MVP - Outlook

    Friday, February 7, 2014 3:31 PM
  • Paul,

    Did you have a chance to look at the following options in the appointment item?

    If the "Allow New Time Proposals" is checked in the Outlook appointment item by the organizer you can propose anything (change the date and time).

    The following code works like a charm on my PC with Outlook 2013 installed:

    Sub AcceptMeeting()
     Dim myNameSpace As Outlook.NameSpace
     Dim myFolder As Outlook.Folder
     Dim myMtgReq As Outlook.MeetingItem
     Dim myAppt As Outlook.AppointmentItem
     Dim myMtg As Outlook.MeetingItem
     
     Set myNameSpace = Application.GetNamespace("MAPI")
     Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
     Set myMtgReq = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Request'")
     If TypeName(myMtgReq) <> "Nothing" Then
       Set myAppt = myMtgReq.GetAssociatedAppointment(True)
       myAppt.Start = #9/24/2014 1:30:00 PM#
       myAppt.End = #9/24/2014 2:30:00 PM#
       Set myMtg = myAppt.Respond(olMeetingTentative, True, False)
     End If
    End Sub
    

    Friday, February 7, 2014 3:33 PM
  • Hi Ken,

    As far as I can see there are no start or end time properties within a MeetingItem. I can only access them through the AppointmentItem.

    I have tried changing the properties on the Appointment Item in the calendar and the AppointmentItem associated with the MeetingItem retrieved through the Respond method. Neither appears to work unless I'm missing something obvious.

    Paul

    Friday, February 7, 2014 3:41 PM
  • I selected a test appointment I created in my calendar and ran the following Outlook VBA macro to test this. It worked with no problems.

    Sub ChangeAppt()
      Dim a As Outlook.AppointmentItem
      Dim m As Outlook.MeetingItem

      Set a = Application.ActiveExplorer.Selection.Item(1)
      a.Start = #2/11/2014 11:00:00 AM#

      Set m = a.Respond(olMeetingTentative, True, False)
      m.Send
    End Sub

    I tested this on Outlook 2003 and Outlook 2010.


    Ken Slovak MVP - Outlook

    Friday, February 7, 2014 4:23 PM
  • Hi Ken/Eugine,

    Thanks for taking time to look at this.

    I have just run that vba code in 2003 and 2010. When I do it sends a tentative response to the meeting organiser and moves the meeting in my meeting recipient calendar.

    It doesn't send a New time proposal that can be accepted by the organiser.

    Could you confirm that when you run the code you get a proper new time proposed MeetingItem in the organisers inbox that you can accept rather than just the tentative notification?

    If it does work properly in your environment at least I'll have a starting point.

    Thanks

    Paul

    Friday, February 7, 2014 4:45 PM
  • Hi Eugene,

    The code you have supplied gives me the same result as I have outlined in my reply to Ken.

    Thanks for your time on this.

    Could you also confirm that this results in the meeting organiser receiving a New Time Proposed MeetingItem rather than a Tentative notification?

    Thanks

    Paul

    Friday, February 7, 2014 4:47 PM
  • You are right, I (as an organizer) didn't get any notifications.
    Friday, February 7, 2014 4:52 PM
  • Correct. The organizer gets a tentative response with the proposed new time. If the organizer decides to accept that time they change their appointment time to update the meeting for everyone.

    Ken Slovak MVP - Outlook

    Friday, February 7, 2014 6:24 PM
  • Thanks Ken,

    So not a true new time proposal then?

    From what you have replied and what I see when I run the vba code are you are getting a reply that has the new time in the when field which is what I get?

    Rather than the new time in the proposed field?

    If you are getting the first one do you know if it is possible to automate a true new time proposal?

    If you are getting the second, any idea why I might not be getting the same (a long shot I know)?

    Apologies for not posting screen shots but my account needs manual verification before I'm allowed to post images or links.

    Thanks

    Paul

    Monday, February 10, 2014 1:53 PM
  • I get the first condition, as you do. That's what's available to us for a counter proposed time I'm afraid, not what you're looking for.

    Ken Slovak MVP - Outlook

    Monday, February 10, 2014 4:26 PM
  • Hi Ken,

    I'll work around the problem now that I know it's not possible.

    Thanks for looking at this both of you.

    Paul

    Monday, February 10, 2014 4:30 PM