SharedWorkspaceMember.DomainName property (Office)
Gets the domain and user name of the specified SharedWorkspaceMember object in the format domain\user. Read-only.
Note
Beginning with Microsoft Office 2010, this object or member has been deprecated and should not be used.
Syntax
expression.DomainName
expression A variable that represents a SharedWorkspaceMember object.
Example
The following example extracts the domain name from the DomainName property of each shared workspace member and lists members who belong to the "MyCompany"
domain.
Dim swsMember As Office.SharedWorkspaceMember
Dim strDomain As String
Dim strMemberList As String
For Each swsMember In ActiveWorkbook.SharedWorkspace.Members
strDomain = UCase(Left(swsMember.DomainName, _
InStr(swsMember.DomainName, "\") - 1))
If strDomain = "MYCOMPANY" Then
strMemberList = strMemberList & swsMember.Name & vbCrLf
End If
Next
MsgBox strMemberList, vbInformation + vbOKOnly, _
"Members in the MYCOMPANY Domain"
Set swsMember = Nothing
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for