UserPermission.Permission Property

Definition

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

public:
 property int Permission { int get(); void set(int value); };
public int Permission { get; set; }
member this.Permission : int with get, set
Public Property Permission As Integer

Property Value

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 Visual Studio 2012 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)

Applies to