Sdílet prostřednictvím


Importance Property

OlImportance

OlImportance can be one of these OlImportance constants.
olImportanceHigh
olImportanceLow
olImportanceNormal

expression**.Importance**

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Example

This Visual Basic for Applications (VBA) example checks if the item displayed in the topmost inspector is sent by 'Dan Wilson' with 'High' importance. If it is, then it displays a message box to the user. Before running this example, replace 'Dan Wilson' with a valid name in your address book.

Sub CheckSenderName
    Dim myOlApp As Outlook.Application
    Dim myItem As Outlook.MailItem
    Set myOlApp = CreateObject("Outlook.Application")
    Set myItem = myOlApp.ActiveInspector.CurrentItem
    If myItem.Importance = 2 And myItem.SenderName = "Dan Wilson" Then
        MsgBox "This message is sent by your manager with High importance."
    End If
End Sub

Applies to | AppointmentItem Object | ContactItem Object | DistListItem Object | DocumentItem Object | JournalItem Object | MailItem Object | MeetingItem Object | PostItem Object | RemoteItem Object | ReportItem Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object