Been scratching my head on this for a bit and figured I'd better get back to the experts.
First off, I know everything else is working as if I change the code to deal with the default calendar, the events get triggered properly. Here's the situation.
When I run, curCal looks fine in both calls and is pointing to the proper location verified by the number of items that it shows.
There are two functions, GetFolderPath and GetFolder that I copied from elsewhere online. For some reason the GetFolderPath only works with the default folder and errors out on the internet folder so I used the GetFolder for that one. Ideally, would prefer to have one but that can wait.
Function GetFolderPath(ByVal FolderPath As String) As Outlook.Folder Dim oFolder As Outlook.Folder Dim FoldersArray As Variant Dim I As Integer 'On Error GoTo GetFolderPath_Error If Left(FolderPath, 2) = "\\" Then FolderPath = Right(FolderPath, Len(FolderPath) - 2) End If 'Convert folderpath to array FoldersArray = Split(FolderPath, "\") Set oFolder = Application.Session.Folders.Item(FoldersArray(0)) If Not oFolder Is Nothing Then For I = 1 To UBound(FoldersArray, 1) Dim SubFolders As Outlook.Folders Set SubFolders = oFolder.Folders Set oFolder = SubFolders.Item(FoldersArray(I)) If oFolder Is Nothing Then Set GetFolderPath = Nothing End If Next End If 'Return the oFolder Set GetFolderPath = oFolder Exit Function GetFolderPath_Error: Set GetFolderPath = Nothing Exit Function End Function
Public Function GetFolder(strFolderPath As String) As MAPIFolder ' strFolderPath needs to be something like ' "Public Folders\All Public Folders\Company\Sales" or ' "Personal Folders\Inbox\My Folder" Dim objApp As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim colFolders As Outlook.Folders Dim arrFolders() As String Dim I As Long On Error Resume Next strFolderPath = Replace(strFolderPath, "/", "\") arrFolders() = Split(strFolderPath, "\") Set objApp = Application Set objNS = objApp.GetNamespace("MAPI") Set objFolder = objNS.Folders.Item(arrFolders(0)) If Not objFolder Is Nothing Then For I = 1 To UBound(arrFolders) Set colFolders = objFolder.Folders Set objFolder = Nothing Set objFolder = colFolders.Item(arrFolders(I)) If objFolder Is Nothing Then Exit For End If Next End If Set GetFolder = objFolder Set colFolders = Nothing Set objNS = Nothing Set objApp = Nothing End Function
I put a Stop in my curCal_ItemAdd sub and if I use just the default folder value, it triggers just fine. When I use the internet one (iCloud\FMFA), it never triggers.
Figure I'm missing something really simple here but just can't see it.