MailItem.IsConflict vs Conflicts Object

178 Views Asked by At

I am trying to check if a mailitem is in conflict.

I haven't run these yet, but are they equivalent codes, or is there a difference?

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

There are 1 best solutions below

1
On

I searched these links and noticed that it seems both the functions are different.

Conflicts Object (Outlook)

MailItem.IsConflict Property (Outlook)

For the "Conflicts Object", it determine if the item is involved in any conflict.

For the "IsConflict", it determined by the state of the application.

Anyway, I think you need to run the code as above links.