UserPermission.UserId property

Office 2013 and later

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

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

public abstract string UserId { get; }

Property value

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

An instance of the UserPermission class 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.

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.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

In the following example, clicking the Button control gets the specified user from UserPermissionsCollection for the current form, and then displays that user's e-mail address.

public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
   MessageBox.Show(Permission.UserPermissions[1].UserId);
}
Show: