none
Displaying Outlook's Scheduling Assistant by default from new Appointment from EXCEL vba macro RRS feed

  • Question

  • My excel vba applet creates a new appointment request with the following code with a series of email addresses in column(1) on the excel activesheet:

    [code]
    Dim allAddress
    Dim lrow As Integer, x As Integer, i As Integer

    lrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).row

    allAddress = ActiveSheet.Cells(1, 1).Value
    For x = 2 To lrow
         allAddress = allAddress & "; " & ActiveSheet.Cells(x, 1).Value
    Next x

    Dim objApplication As Object 'Outlook Application Object
    Set objApplication = CreateObject("Outlook.Application")

        Dim objAppointment As Object 'AppointmentItem Item
        Set objAppointment = objApplication.CreateItem(1)

            'Appointment properties
            objAppointment.Location = "Steve's Office"
            objAppointment.Start = Now + 1
            objAppointment.Duration = 60
            objAppointment.Subject = "Study Meeting"
            objAppointment.RequiredAttendees = allAddress

    objAppointment.display

    [/code]

    Which works just fine as far as I can tell.

    But instead of opening to the Appointment display view I would like it to open to the Scheduling Assistant display view by default instead but nothing I've tried so far seems to want to work.  

    This will eventually be a distributed solution I would like to avoid having to add the Microsoft Outlook 15.0 Object Library in excel so early binding solutions won't work here.

    And since there is no macro recording in Outlook to help me cheat on figuring out objects and syntax I fear I'm just throwing code at the wall at this point hoping something sticks.

    Any help would be most appreciated.

                
    Friday, February 10, 2017 1:20 AM

Answers

  • Hi,

    Please use Inspector.SetSchedulingStartTime Method (Outlook)

     Set oInsp = objAppointment.GetInspector 
     ' Switch to the Scheduling Assistant tab in that inspector. 
    oInsp.SetCurrentFormPage ("Scheduling Assistant") 
     

    Regards,

    Celeste




    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by O Higa Friday, February 10, 2017 8:32 PM
    Friday, February 10, 2017 8:57 AM
    Moderator

All replies

  • Hi,

    Please use Inspector.SetSchedulingStartTime Method (Outlook)

     Set oInsp = objAppointment.GetInspector 
     ' Switch to the Scheduling Assistant tab in that inspector. 
    oInsp.SetCurrentFormPage ("Scheduling Assistant") 
     

    Regards,

    Celeste




    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by O Higa Friday, February 10, 2017 8:32 PM
    Friday, February 10, 2017 8:57 AM
    Moderator
  • Perfect.  Not sure what Inspectors are, never used them over in Excel VBA, but it worked perfectly.  Will have to circle around to understand the Outlook object model some day but for now we're rolling.  Thank you!
    Friday, February 10, 2017 8:34 PM