什么时候MailItem不是MailItem? [英] When is a MailItem not a MailItem?

查看:150
本文介绍了什么时候MailItem不是MailItem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Outlook的Visual Basic(我们正在使用Outlook 2003和Exchange Server)中编写了一个消息处理程序功能,以帮助我整理传入的电子邮件.

I have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email.

它对我有用,除了有时规则失败并且Outlook将其禁用.

It is working for me, except sometimes the rule fails and Outlook deactivates it.

然后,我重新打开规则,并在收件箱"中手动运行该规则以进行跟踪.该规则自发地失败,并且每天停用几次.

Then I turn the rule back on and manually run it on my Inbox to catch up. The rule spontaneously fails and deactivates several times a day.

我很想一劳永逸地解决这个问题.

I would love to fix this once and for all.

推荐答案

此代码向我显示了收件箱中不同的TypeName:

This code showed me the different TypeNames that were in my Inbox:

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

这篇关于什么时候MailItem不是MailItem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆