S
Slava
Hi,
I want to set up a simply test project: at Inbox, when new email will
arrive,
then simply message will be displayed :
ThisOutlookSession :
Private Sub Application_Quit()
Set objInboxItems = Nothing
End Sub
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set objInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Inserting : Class Modules : objInboxItems :
Private WithEvents objInboxItems As Items
Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
MsgBox "New Item Subject: " & Item.Subject
End Sub
save/compile project,
closing Outlook, starting Outlook,
then will appeare dialog about Macro-s, I accept macros,
new email will arrive, but no MsgBox ((
what is wrong in this simply example ?
thank you for any idea,
slava
I want to set up a simply test project: at Inbox, when new email will
arrive,
then simply message will be displayed :
ThisOutlookSession :
Private Sub Application_Quit()
Set objInboxItems = Nothing
End Sub
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set objInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Inserting : Class Modules : objInboxItems :
Private WithEvents objInboxItems As Items
Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
MsgBox "New Item Subject: " & Item.Subject
End Sub
save/compile project,
closing Outlook, starting Outlook,
then will appeare dialog about Macro-s, I accept macros,
new email will arrive, but no MsgBox ((
what is wrong in this simply example ?
thank you for any idea,
slava