I am trying to write a script (which i have done) that sends a meeting request out from Access to users outlook. When they accept it adds that meeting to their outlook. But if a user declines it deletes that meeting out of everybodys outlook.
e.g. if I send a meeting request out to 3 people from access and 2 people accept and 1 declines it then deletes that meeting from all 3 peoples calendars.
Thanks.
my code is below:
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.AppointmentItem
Dim myRequiredAttendee As Outlook.Recipient
Dim myOptionalAttendee As Outlook.Recipient
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Holiday for approval for " & [txt_Name]
myItem.Location = "Conference Room B"
myItem.Start = [txt_date]
'myItem.Start = #1/26/2006 12:00:00 PM#
myItem.End = [txtEndDate]
'myItem.Duration = 30
myItem.Body = "Holiday requested: " & Chr(13) & [txt_date] & " to " & [txtEndDate]
Set myRequiredAttendee = myItem.Recipients.Add("Owen, Jo")
myRequiredAttendee.type = olRequired
If Text7 <> "" Then
Set myRequiredAttendee = myItem.Recipients.Add([Text7])
myRequiredAttendee.type = olRequired
Else
myItem.Send
End If
If Text14 <> "" Then
Set myRequiredAttendee = myItem.Recipients.Add([Text14])
myRequiredAttendee.type = olRequired
Else
myItem.Send
End If
'Set myOptionalAttendee = myItem.Recipients.Add("Dog, Spot")
'myOptionalAttendee.type = olOptional
myItem.Send