Issue with Outlook Event for New Mail

China☆狼群 提交于 2019-12-11 07:37:36

问题


I would like to do some operation when a new mail comes to mailbox. For that I am using Item_Add() Event

Private Sub myOlItems_ItemAdd(ByVal Item As Object)
   ... Do Something
Exit Sub

Can anyone tell me How to set the Handler for "inbox" folder under "gilbertojperera@gmail.com"?

Problem:

The issue I am facing here is that this even get fired only when a new mail comes in "Inbox" folder under "Outlook Data File". But I used to receive mails in the other "Inbox" folder marked by second red arrow (third last folder)

Due to this problem My Item_Add() event is not being triggered & resulting to my outlook macro Fail.

Please do help if you have some valuable inputs.


回答1:


It sounds like you only initialized the handler for the Inbox DefaultFolder (olFolderInbox). You also must add a handler to the Inbox folder for gilbertojperera@gmail.com.



来源:https://stackoverflow.com/questions/23593671/issue-with-outlook-event-for-new-mail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!