Attribute VB_Name = "Module1"
Sub main()
    Call SendMeetingRequest
    Call AcceptMeetingRequest
    Call AdjustAttendeeStatus
End Sub
Public Sub SendMeetingRequest()
Dim oCfgOrg As New CDO.Configuration
Dim oAppt As New CDO.Appointment
Dim oReq As New CDO.CalendarMessage
Dim strOrgURL As String

strOrgURL = "file://./backofficestorage/ywd.extest.microsoft.com/mbx/user1/"

oCfgOrg.Fields(cdoSendEmailAddress) = "user1@ywd.extest.microsoft.com"
oCfgOrg.Fields(cdoSendUsingMethod) = cdoSendUsingExchange
oCfgOrg.Fields("CalendarLocation") = strOrgURL & "calendar/"
oCfgOrg.Fields.Update

With oAppt
    .StartTime = Now
    .EndTime = .StartTime + (1 / 24)
    .Subject = "Meeting"
    .TextBody = "Let us talk about something"
    .Location = "My office"
End With

Set oAppt.Configuration = oCfgOrg
oAppt.Attendees.Add "user2@ywd.extest.microsoft.com"
oAppt.Attendees.Add "user3@ywd.extest.microsoft.com"
oAppt.DataSource.SaveToContainer strOrgURL & "calendar/"

Set oReq.Configuration = oCfgOrg
Set oReq = oAppt.CreateRequest
oReq.Message.Send

Set oCfgOrg = Nothing
Set oAppt = Nothing
Set oReq = Nothing
End Sub
Public Sub AcceptMeetingRequest()
Dim oCfgAtt As New CDO.Configuration
Dim oAppt As New CDO.Appointment
Dim oReq As New CDO.CalendarMessage
Dim oResp As New CDO.CalendarMessage
Dim oRS As New ADODB.Recordset
Dim oRec As New ADODB.Record
Dim strAttURL As String

strAttURL = "file://./backofficestorage/ywd.extest.microsoft.com/mbx/user2/"

oCfgAtt.Fields(cdoSendEmailAddress) = "user2@ywd.extest.microsoft.com"
oCfgAtt.Fields(cdoSendUsingMethod) = cdoSendUsingExchange
oCfgAtt.Fields("CalendarLocation") = strAttURL & "calendar/"
oCfgAtt.Fields.Update

oRec.Open strAttURL & "inbox/"
Set oRS = oRec.GetChildren
Debug.Print oRS.Fields("DAV:href")

Set oReq.Configuration = oCfgAtt
oReq.DataSource.Open oRS.Fields("DAV:href"), , adModeReadWrite

Set oAppt.Configuration = oCfgAtt
Set oAppt = oReq.CalendarParts(1).GetUpdatedItem
oAppt.DataSource.SaveToContainer strAttURL & "calendar/"

Set oResp.Configuration = oCfgAtt
Set oResp = oAppt.Accept
oResp.Message.Send
    
Set oCfgAtt = Nothing
Set oAppt = Nothing
Set oReq = Nothing
Set oResp = Nothing
Set oRS = Nothing
Set oRec = Nothing
End Sub
Public Sub AdjustAttendeeStatus()
Dim oCfgOrg As New CDO.Configuration
Dim oAppt As New CDO.Appointment
Dim oReq As New CDO.CalendarMessage
Dim oRS As New ADODB.Recordset
Dim oRec As New ADODB.Record
Dim strOrgURL As String

strOrgURL = "file://./backofficestorage/ywd.extest.microsoft.com/mbx/user1/"

oCfgOrg.Fields(cdoSendEmailAddress) = "user1@ywd.extest.microsoft.com"
oCfgOrg.Fields(cdoSendUsingMethod) = cdoSendUsingExchange
oCfgOrg.Fields("CalendarLocation") = strOrgURL & "calendar/"
oCfgOrg.Fields.Update

oRec.Open strOrgURL & "inbox/"
Set oRS = oRec.GetChildren
Debug.Print oRS.Fields("DAV:href")

Set oReq.Configuration = oCfgOrg
oReq.DataSource.Open oRS.Fields("DAV:href"), , adModeReadWrite

Set oAppt.Configuration = oCfgOrg
Set oAppt = oReq.CalendarParts(1).GetUpdatedItem
oAppt.DataSource.Save
    
Set oCfgOrg = Nothing
Set oAppt = Nothing
Set oReq = Nothing
Set oRS = Nothing
Set oRec = Nothing

End Sub
