New/Updated post notifications

  • Thread starter Thread starter Jerry Camel
  • Start date Start date
J

Jerry Camel

I've been trying to hook into an event that would allow me to send an email
notification when an item in a particular public folder has been added or
updated:

Dim WithEvents myFolder As Outlook.Folders

Private Sub Application_Startup()
Set myFolder = Session.Folders
End Sub

Private Sub myFolder_FolderAdd(ByVal Folder As MAPIFolder)
MsgBox Folder.Name & " has been added."
'Check folder name and if correct folder, then send notification.
End Sub

Private Sub myFolder_FolderChange(ByVal Folder As MAPIFolder)
MsgBox Folder.Name & " has changed."
'Check folder name and if correct folder, then send notification.
End Sub


But I'm not getting any event triggers... Any help is appreciated. Thanks.

Jerry
 
I can get the folder without a problem, I'm doing that for my reporting, but
how do I get notifications on changes in that folder? I don't see a Folder
object that I can declare WithEvents...
 
That's what I'm trying to tell you -- you already have the object declared
WithEvents. You're just not instantiating it correctly so that it points at
the particular folder that you want to monitor. In other words, you need to
set myFolder to that particular folder.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Okay... I'll try that. I thought it had to point to a folders collection.
Didn't realize it could point to a specific folder.

Thanks.

Jerry
 
Back
Top