1
我已經在各種網站上看到了一些處理此問題的帖子,但尚未得到它的工作。也許我很密集,不知道,但這裏有: 事件似乎並不想開火。在ThisOutlookSession
在頂部潛艇前/功能中 代碼:VBA Outook 2010 - 編碼ItemAdd事件
'Declare event handler
Public WithEvents myOutlookItems As Outlook.Items
Private Sub Application_Startup()
Set myOutlookItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Items
End Sub
Public Sub myOutlookItems_ItemAdd(ByVal Item As Object)
If TypeName(Item) = MailItem Then
MsgBox ("Got a message")
End If
End Sub'
感謝您的幫助!
看一看宏安全。默認情況下,未簽名的宏被禁用 – SBF
謝謝,但這是非常開放的,我有其他的宏正在觸發(即application_itemsend) –
像@DmitryStreblechenko說使用'olMail'或''MailItem「'它應該工作。 – 0m3r