我在Outlook的Visual Basic(我们使用的是Outlook 2003和Exchange Server)中编写了一个消息处理函数来帮助我整理收到的电子邮件.
它对我有用,除非有时规则失败并且Outlook停用它.
然后我重新打开规则并在我的收件箱中手动运行以赶上.该规则自发地失败并且每天停用几次.
我想一劳永逸地解决这个问题.
此代码向我显示了收件箱中的不同TypeNames:
Public Sub GetTypeNamesInbox() Dim myOlItems As Outlook.Items Set myOlItems = application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items Dim msg As Object For Each msg In myOlItems Debug.Print TypeName(msg) 'emails are typename MailItem 'Meeting responses are typename MeetingItem 'Delivery receipts are typename ReportItem Next msg End Sub
HTH