指定したインデックスの UserPermission オブジェクトを取得します。
名前空間: Microsoft.Office.Interop.InfoPath
アセンブリ: Microsoft.Office.Interop.InfoPath (microsoft.office.interop.infopath.dll 内)
構文
'宣言
<DispIdAttribute(0)> _
ReadOnly Default Property Item ( _
<InAttribute> varIndex As Object _
) As UserPermissionObject
'使用
Dim instance As Permission
Dim varIndex As Object
Dim value As UserPermissionObject
value = instance(varIndex)
[DispIdAttribute(0)]
UserPermissionObject this [
[InAttribute] Object varIndex
] { get; }
パラメータ
- varIndex
Permission コレクション内の UserPermission オブジェクトの数値インデックス、または現在のフォームに対するアクセス許可のセットを取得するユーザーの電子メール アドレス。
プロパティ値
指定したユーザーを表す UserPermission オブジェクト。指定した varIndex が存在しない場合は、null を返します。
例
次の例では、Item プロパティを使用して、電子メール アドレス "someone@example.com" に関連付けられたユーザーの UserPermission オブジェクトを取得した後、UserPermission オブジェクトの Permission プロパティを使用して、ユーザーのアクセス許可を Change アクセス レベルに設定しています。
アクセス許可を設定するために MsoPermission 列挙値にアクセスするには、Microsoft Visual Studio Tools for Applications (VSTA) または Visual Studio の [参照の追加] ダイアログ ボックスの [COM] タブを使用して、Microsoft Office 12.0 Object Library への参照を設定する必要があります。これにより、Microsoft.Office.Core 名前空間のメンバへの参照が確立されます。
この例では、フォーム モジュールの宣言セクションの Microsoft.Office.Core 名前空間に using ディレクティブまたは Imports ディレクティブが必要です。
_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)
関連項目
参照
Permission インターフェイス
Permission のメンバ
Microsoft.Office.Interop.InfoPath 名前空間