Permission.Item[Object] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the UserPermission object at the specified index.
public:
property Microsoft::Office::Interop::InfoPath::UserPermissionObject ^ default[System::Object ^] { Microsoft::Office::Interop::InfoPath::UserPermissionObject ^ get(System::Object ^ varIndex); };
public Microsoft.Office.Interop.InfoPath.UserPermissionObject this[object varIndex] { get; }
member this.Item(obj) : Microsoft.Office.Interop.InfoPath.UserPermissionObject
Default Public ReadOnly Property Item(varIndex As Object) As UserPermissionObject
Parameters
- varIndex
- 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
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 Visual Studio 2012 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)
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기