UserPermission.UserId property

Gets the e-mail address of the user whose permissions on the current form are determined by the specified UserPermission object.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property UserId As String
    Get
'Usage
Dim instance As UserPermission
Dim value As String

value = instance.UserId
string UserId { get; }

Property value

Type: System.String
The user's e-mail address.

Remarks

The UserPermission object associates a set of permissions on the current form with a single user and an optional expiration date. The UserId property returns the e-mail address of the user whose permissions are determined by the UserPermission object.

Because the UserPermission object and its members are new to Microsoft InfoPath, you must cast the object returned by the thisXDocument variable to the _XDocument3 type to access this object and its members. For more information, see How to: Use Microsoft.Office.Interop.InfoPath.SemiTrust Members That Are Not Compatible with InfoPath 2003.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the second UserPermission object retrieved from the Permission collection for the current form, and then the UserId property is used to display the user's e-mail address.

_XDocument3 thisDoc = (_XDocument3)thisXDocument;
UserPermission thisUser = 
   thisDoc.Permission[1];
thisXDocument.UI.Alert(thisUser.UserId);
Dim thisDoc As _XDocument3 = DirectCast(thisXDocument, _XDocument3)
UserPermission thisUser = 
   Permission.UserPermissions(1)
thisXDocument.UI.Alert(thisUser.UserId)

See also

Reference

UserPermission interface

UserPermission members

Microsoft.Office.Interop.InfoPath.SemiTrust namespace