Share via


XmlForm.UserRole Property (Microsoft.Office.InfoPath)

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
'Usage
Dim instance As XmlForm
Dim value As String

value = instance.UserRole

instance.UserRole = value
public abstract string UserRole { get; set; }

Property Value

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

Remarks

Note

The UserRole property provides similar functionality to the Role property of the XDocument object in the COM/Scripting object model, and to the Role property of the _XDocument2 interface of the InfoPath 2003-compatible managed code object model.

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 Office InfoPath 2007.

Example

In the following 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