Syntax

expression.Add(Email, DomainName, DisplayName, Role)

expression Required. A variable that represents a object.

Parameters

Name Required/Optional Data Type Description
Email Required String The new member's e-mail address in the format user@domain.com. Raises an error if the user is not a valid candidate for membership in the shared workspace site.
DomainName Required String The new member's Windows user name in the format domain\user.
DisplayName Required String The display name to display for the new member.
Role Optional String An optional role that determines the tasks the new member can accomplish in the shared workspace site; for example, "Contributor". An invalid role name raises an error.

Example

The following example adds a new member to the members collection of the shared workspace site in the role of a site contributor.

Visual Basic for Applications
 Dim swsMember As Office.SharedWorkspaceMember Set swsMember = ActiveWorkbook.SharedWorkspace.Members.Add( _ "user@domain.com", _ "domain\user", _ "New User", _ "Contributor") MsgBox "New member: " & swsMember.Name, _ vbInformation + vbOKOnly, _ "New Member in Shared Workspace)" Set swsMember = Nothing 

See also: