PDA

View Full Version : Setting .BusyStatus = olFree not working?



chadknudson
03-25-2015, 02:24 PM
I'm trying to use this macro in my inbox for incomming outlook calendar invites that will accept an appointment, set reminder to none, and busy status to free. Everything is working except the busy status is not changing to free (as if it's not reading this line of code, I've tried 0 instead of olFree also but no luck). Can you tell me what I'm doing wrong? Here is my code and I'm using Office 2010...

Sub Accept_No_Reminder_Free_Status()

Dim oRequest As MeetingItem
Dim oAppt As Outlook.AppointmentItem

Set oRequest = Application.ActiveExplorer.Selection.Item(1)
If oRequest.MessageClass = "IPM.Schedule.Meeting.Request" Then
Set oAppt = oRequest.GetAssociatedAppointment(True)

'set fields on the appt.
With oAppt
.Categories = None
.ReminderSet = False
.BusyStatus = olFree
.Save
End With
End If
'autoaccept and send response
Dim oResponse
Set oResponse = oAppt.Respond(olMeetingAccepted, True)
oResponse.Send
'delete the request from the inbox
oRequest.Delete
End Sub

gmayor
03-26-2015, 12:56 AM
I suspect it is the categories value which should be


.Categories = ""


With oAppt
.BusyStatus = olFree
.Categories = ""
.ReminderSet = False
.Save
End Withappears to work here.

chadknudson
03-26-2015, 06:00 AM
Thanks for the quick response, I tried that and it’s still not working. I even tried changing the reminder status to test oAppt, and that one changed, but the busy status keeps going to the default of Busy (even if I change it to olOutOfOffice, or olTentative it stays with busy). Any other ideas?

gmayor
03-26-2015, 06:14 AM
It makes the change here, with those code modifications, so I regret I have no other suggestions as to why it doesn't work for you.