Export (0) Print
Expand All

XmlForm.UserRole property

Gets or sets the current user of the form's role name.

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

public abstract string UserRole { get; set; }

Property value

Type: System.String
The user's role name as defined in design mode with the User Roles command on the Tools menu.

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 code example, the UserRole property is used set a variable with the role name of the current user.

string currentRole = this.UserRole;
Show:
© 2014 Microsoft