NameSpace.Categories property (Outlook)
Returns or sets a Categories object that represents the set of Category objects that are available to the namespace. Read/write.
Syntax
expression. Categories
expression A variable that represents a 'NameSpace' object.
Remarks
This property represents the Master Category List, which is the set of Category objects that can be applied to Outlook items contained by the NameSpace object, and applies to all users of that namespace.
This property is similar to the Categories property of the Store object. If there are multiple accounts defined in the current profile, use the Categories property of the store that is associated with the specific account.
Example
The following Visual Basic for Applications (VBA) example displays a dialog box that contains the names and identifiers for each Category object that is contained in the Categories collection associated with the default NameSpace object.
Private Sub ListCategoryIDs()
Dim objNameSpace As NameSpace
Dim objCategory As Category
Dim strOutput As String
' Obtain a NameSpace object reference.
Set objNameSpace = Application.GetNamespace("MAPI")
' Check whether the Categories collection for the Namespace
' contains one or more Category objects.
If objNameSpace.Categories.Count > 0 Then
' Enumerate the Categories collection.
For Each objCategory In objNameSpace.Categories
' Add the name and ID of the Category object to
' the output string.
strOutput = strOutput & objCategory.Name & _
": " & objCategory.CategoryID & vbCrLf
Next
End If
' Display the output string.
MsgBox strOutput
' Clean up.
Set objCategory = Nothing
Set objNameSpace = Nothing
End Sub
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기