Share via


Permission.Item Property

Gets the UserPermission object at the specified index.

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

Syntax

'Declaration
ReadOnly Default Property Item ( _
    varIndex As Object _
) As UserPermissionObject
    Get
'Usage
Dim instance As Permission
Dim varIndex As Object
Dim value As UserPermissionObject

value = instance(varIndex)
UserPermissionObject this[
    Object varIndex
] { get; }

Parameters

  • varIndex
    Type: System.Object

    The numeric index of the UserPermission object in the Permission collection, or the email address of the user whose set of permissions on the current form is to be returned.

Property Value

Type: Microsoft.Office.Interop.InfoPath.UserPermissionObject
A UserPermission object that represents the specified user. Returns a null reference (Nothing in Visual Basic) if the specified varIndex does not exist.

Examples

In the following example, the Item property is used to get the UserPermission object for the user associated with the e-mail address "someone@example.com", and then uses the Permission property of the UserPermission object 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. 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;
thisDoc.Permission["someone@example.com"].Permission = 
   (int)MsoPermission.msoPermissionChange;
Dim thisDoc As _XDocument3 = DirectCast(thisXDocument, _XDocument3)
thisDoc.Permission["someone@example.com"].Permission = _
   DirectCast(MsoPermission.msoPermissionChange, Integer)

See Also

Reference

Permission Interface

Permission Members

Microsoft.Office.Interop.InfoPath Namespace