共用方式為


Outlook) (MailItem.Importance 屬性

會傳回或設定 OlImportance 常 數,指出 Outlook 專案的相對重要性層級。 讀取/寫入。

語法

expressionImportance

表達 代表 MailItem 物件的 變數。

註解

這個屬性會對應至 MAPI 屬性 PidTagImportance

範例

在這個 Visual Basic for Applications (VBA) 範例中,會檢查最上層查閱程式中所顯示的項目是否為 'Dan Wilson' 所傳送並具有 'High' 重要性。 如果是,則會對使用者顯示訊息方塊。 執行這個範例之前,請以您通訊錄中的有效名稱取代 'Dan Wilson'。

Sub CheckSenderName 
 
 Dim myItem As Outlook.MailItem 
 
 
 
 Set myItem = Application.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

另請參閱

MailItem 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應