DistListItem.MemberCount property (Outlook)
Returns a Long indicating the number of members in a distribution list. Read-only.
Syntax
expression. MemberCount
expression A variable that represents a DistListItem object.
Remarks
The value returned represents all members of the distribution list, including member distribution lists. Each member distribution list is counted as a single member. That is, MemberCount is not an aggregate sum of the recipients in the distribution list plus recipients in member distribution lists. For example, if a distribution list contains 10 recipients plus one distribution list containing 15 recipients, MemberCount returns 11.
Example
This Microsoft Visual Basic for Applications example steps through the default Contacts folder, and if it finds a distribution list with more than 20 members it displays the item.
Sub CheckDLs()
Dim myOlFolder As Outlook.Folder
Dim myOlItems As Outlook.Items
Dim myOlDistList As Outlook.DistListItem
Dim x as Integer
Set myOlFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)
Set myOlItems = myOlFolder.Items
For x = 1 To myOlItems.Count
If TypeName(myOlItems.Item(x)) = "DistListItem" Then
Set myOlDistList = myOlItems.Item(x)
If myOlDistList.MemberCount > 20 Then
MsgBox myOlDistList.DLName & " has more than 20 members."
myOlDistList.Display
End If
End If
Next x
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 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기