0
我的代碼在我的系統中運行,但在我朋友的PC中運行。兩者都使用相同的Outlook版本。儘管itemadd事件在我的outlook中起作用,但它在朋友電腦中不起作用
以下是摘錄。
Private WithEvents olInboxItems As Items
Private Sub start_Click()
Dim objNS As nameSpace
Set objNS = Application.Session
' instantiate objects declared WithEvents
Call accessInbox(inbox) // my own function
Set olInboxItems = inbox.Items
'Set objNS = Nothing
Me.Hide
End Sub
Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next
MsgBox "a Message recieved"
'Call download(Item)
Call multiSubjectDownload(Item) //my own function
End Sub
可能是什麼問題?
是否有不同的設置可以阻止代碼檢測收件箱中的新郵件?