MailItem.IsConflict vs冲突对象

时间:2018-11-17 11:22:51

标签: vba object outlook conflict mailitem

我正在尝试检查邮件项是否存在冲突。

我还没有运行这些代码,但是它们是等效代码还是有区别?

Sub CheckConflict1()
    Dim myItem As Outlook.MailItem
    Set myItem = Application.ActiveInspector.CurrentItem
    Dim myConflicts As Outlook.Conflicts
    Set myConflicts = myItem.Conflicts

    If (myConflicts.Count > 0) Then
        MsgBox ("This item is involved in a conflict.")
    Else
        MsgBox ("This item is not involved in any conflicts.")
    End If
End Sub


Sub CheckConflict2()
    Dim myItem As Outlook.MailItem
    Set myItem = Application.ActiveInspector.CurrentItem

    If (myItem.IsConflict = False) Then
        MsgBox ("This item is involved in a conflict.")
    Else
        MsgBox ("This item is not involved in any conflicts.")
    End If
End Sub

1 个答案:

答案 0 :(得分:0)

我搜索了这些链接,发现似乎两个功能都不同。

Conflicts Object (Outlook)

MailItem.IsConflict Property (Outlook)

对于“冲突对象”,它确定项目是否涉及任何冲突。

对于“ IsConflict”,它由应用程序的状态决定。

无论如何,我认为您需要按照上面的链接运行代码。