Trigger ItemAdd event with MAPI/Internet calendar

  • 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.

    Dim WithEvents curCal As ItemsPrivate Sub Application_Startup()
      Dim NS As Outlook.NameSpace
      Set NS = Application.GetNamespace("MAPI")
      Set curCal = NS.GetDefaultFolder(olFolderCalendar).Items
      Set curCal = GetFolder("iCloud\FMFA").Items
      Set NS = Nothing
    End Sub

    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.

    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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!