Steve Anthony
New Member
- Outlook version
- Outlook 2016 32 bit
- Email Account
- Office 365 Exchange
I have had some simple code to set a category in an appointment.
This has been working until recently.
After much debugging, I've identified the root cause - appointments/meetings that come from other people.
The code still works for appointments that I create, but fails for others.
I was recently migrated from a local Exchange (2007?) to Exchange Online - unsure if this is related or not.
Simple example of the code (which will remove a category if it exists, add it if it does not):
On any assignment of "objAppt.Categories", i receive the following error for appointments that I don't create:
Run-time error '440' : Object doesn't support this property or method
If I examine objAppt as a watch variable, I see :
: ConversationID : <Object doesn't support this property or method>
Since this is a read-only field, I'm befuddled at how to work around this.
Greatly appreciate any help!
Steve
This has been working until recently.
After much debugging, I've identified the root cause - appointments/meetings that come from other people.
The code still works for appointments that I create, but fails for others.
I was recently migrated from a local Exchange (2007?) to Exchange Online - unsure if this is related or not.
Simple example of the code (which will remove a category if it exists, add it if it does not):
Code:
Sub SetCategory(inCat As String)
Dim objAppt As Object
Dim i As Integer
Dim strCats As String
Dim bCatFound As Boolean
Set objAppt = Application.ActiveExplorer.Selection.Item(1)
strCats = objAppt.Categories
If Len(strCats) = 0 Then
objAppt.Categories = inCat
Else
'Check if category is already there - if so that means we need to delete
If InStr(1, strCats, inCat) > 0 Then
' may not need to handle extra commas; if so, build a function
objAppt.Categories = Replace(strCats, inCat, "")
Else
objAppt.Categories = inCat & "," & strCats
End If
End If
Set objAppt = Nothing
End Sub
On any assignment of "objAppt.Categories", i receive the following error for appointments that I don't create:
Run-time error '440' : Object doesn't support this property or method
If I examine objAppt as a watch variable, I see :
: ConversationID : <Object doesn't support this property or method>
Since this is a read-only field, I'm befuddled at how to work around this.
Greatly appreciate any help!
Steve