AppointmentItem.Categories 屬性 (Outlook)

會傳回或設定 String,代表指派給 Outlook 項目的類別。 讀取/寫入。

語法

expressionCategories

表達 代表 AppointmentItem 物件的 變數。

註解

Categories 是指定給 Outlook 項目的類別名稱分隔字串。 此屬性會使用 Windows 登錄中 HKEY_CURRENT_USER\Control Panel\International 之下 sList 數值名稱中指定的字元,做為多個類別的分隔字元。 若要將類別名稱字串轉換成任何類別名稱陣列,請使用 Microsoft Visual Basic 的 Split 函數。

範例

下列 Microsoft Visual Basic for Applications (VBA) 範例會建立一個新約會,並在螢幕上顯示該約會,然後開啟 [顯示類別] 對話方塊。 最後,它會顯示使用者使用 AppointmentItem.ShowCategoriesDialog指派的類別。 在執行此範例之前,請先將 'Dan Wilson' 取代成有效的收件者名稱。

Sub Appointment() 
 
 'Creates an appointment to access ShowCategoriesDialog 
 
 Dim olApptItem As Outlook.AppointmentItem 
 
 
 
 'Creates appointment item 
 
 Set olApptItem = Application.CreateItem(olAppointmentItem) 
 
 olApptItem.Body = "Please meet with me regarding these sales figures." 
 
 olApptItem.Recipients.Add ("Dan Wilson") 
 
 olApptItem.Subject = "Sales Reports" 
 
 'Display the appointment 
 
 olApptItem.Display 
 
 'Display the Show Categories dialog box 
 
 olApptItem.ShowCategoriesDialog 
 
 MsgBox olApptItem.Categories 
 
End Sub

另請參閱

AppointmentItem 物件

支援和意見反應

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