I am using VBA to accept certain calendar invites. When the meeting invite requests a response, I'm able to accept and send the response while setting the category for the copy stored on my calendar with the following script (also discussed here).
Attempt to set category when no response is requested.
For x = Application.ActiveWindow.Selection.Count To 1 Step -1
If (Application.ActiveWindow.Selection.Item(x).MessageClass = "IPM.Schedule.Meeting.Request") Then
Set cAppt = Application.ActiveWindow.Selection.Item(x).GetAssociatedAppointment(True)
Set oRequest = cAppt.Respond(olMeetingAccepted, True)
If cAppt.ResponseRequested = True Then
oRequest.Send
oRequest.Categories = "xxxx"
Else
cAppt.Categories = "xxxx"
End If
End If
Next x
When the invite does not request a response, no MeetingItem is generated and setting the category on the original AppointmentItem has no effect (e.g. cAppt.Categories = "xxxx"
).