UserPermission.Permission Property

Gets or sets a value representing the permissions on the current form assigned to the user associated with a UserPermission object.

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

Syntax

'Declaration
Property Permission As Integer
    Get
    Set
'Usage
Dim instance As UserPermission
Dim value As Integer

value = instance.Permission

instance.Permission = value
int Permission { get; set; }

Property Value

Type: System.Int32
An integer value that corresponds to one of the MsoPermission enumeration values.

Examples

In the following example, the user associated with the e-mail address "someone@example.com" is retrieved from the Permission collection of the form and assigned to a UserPermission object. Then, the Permission property of the UserPermission object is used to set that user's permissions to the Change access level.

To access the MsoPermission enumeration values for setting permissions, you must set a reference to the Microsoft Office 14.0 Object Library using COM tab of the Add Reference dialog box in Microsoft Visual Studio Tools for Applications or Visual Studio 2005. This will establish a reference to the members of the Microsoft.Office.Core namespace.

This example requires a using or Imports directive for the Microsoft.Office.Core namespace in the declarations section of the form module.

_XDocument3 thisDoc = (_XDocument3)thisXDocument;

UserPermission thisUser = thisDoc.Permission["someone@example.com"];

thisUser.Permission = 
   (int)MsoPermission.msoPermissionChange;
Dim thisDoc As _XDocument3 = DirectCast(thisXDocument, _XDocument3)

Dim thisUser As UserPermission = _
   thisDoc.Permission["someone@example.com"];

thisUser.Permission = _
   DirectCast(MsoPermission.msoPermissionChange, Integer)

See Also

Reference

UserPermission Interface

UserPermission Members

Microsoft.Office.Interop.InfoPath Namespace