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)

Syntax

'Declaration
Public MustOverride Property UserRole As String
    Get
    Set
'Usage
Dim instance As XmlForm
Dim value As String

value = instance.UserRole

instance.UserRole = value
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.

Remarks

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.

Examples

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;
Dim currentRole As String = Me.UserRole

See Also

Reference

XmlForm Class

XmlForm Members

Microsoft.Office.InfoPath Namespace