-1
你好,我有这个完美的代码,我发现。它检查新消息,并且只在日期和时间中添加自定义列。它非常适合按收到然后从收信人分组。Outlook VBA多个Acounts运行脚本
但它只适用于我的默认帐户,可以使用多个帐户吗?
Private Sub Application_Quit()
Set myInbox = Nothing
End Sub
Private Sub Application_Startup()
Set myInbox = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub myInbox_ItemAdd(ByVal Item As Object)
Item.UserProperties.Add "DateReceived", olDateTime
Item.UserProperties.Item("DateReceived") = DateValue(Item.ReceivedTime)
Item.Save
End Sub
请参阅此处:http://stackoverflow.com/questions/33953386/vba-to-select-mailbox-if-an-account-has-multiple-mailboxs – OpiesDad
可能重复[获取对其他收件箱的引用](http ://stackoverflow.com/questions/9076634/get-reference-to-additional-inbox) – niton
以及http://stackoverflow.com/questions/26274516/vba-get-email-from-non-default-inbox和http://stackoverflow.com/questions/6849068/get-inboxes-from-outlook – niton