New/Updated post notifications

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
 
J

Jerry Camel

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

Sue Mosher [MVP-Outlook]

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
 
J

Jerry Camel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top