_XDocument2.SetDataVariable メソッド
フォームの基になる XML ドキュメントに処理命令属性として格納されている定義済みの変数の値を設定します。
このメソッドは、CLS に準拠していません。
名前空間: Microsoft.Office.Interop.InfoPath.SemiTrust
アセンブリ: Microsoft.Office.Interop.InfoPath.SemiTrust (microsoft.office.interop.infopath.semitrust.dll 内)
構文
'宣言
<DispIdAttribute(21)> _
Sub SetDataVariable ( _
lVariableNumber As Integer, _
bstrVariableValue As String _
)
'使用
Dim instance As _XDocument2
Dim lVariableNumber As Integer
Dim bstrVariableValue As String
instance.SetDataVariable(lVariableNumber, bstrVariableValue)
[DispIdAttribute(21)]
void SetDataVariable (
int lVariableNumber,
string bstrVariableValue
)
パラメータ
- lVariableNumber
変数の数。
- bstrVariableValue
変数の値。
コメント
SetDataVariable メソッドは、設定される変数が有効な処理命令属性ではない場合にはエラーを返します。
変数の値を取得するには、GetDataVariable メソッドを使用します。
メモ : |
---|
InfoPath では、initialView 変数のみを使用できます。この変数は、フォームを開いたときに最初に表示するビューを指定する変数です。この変数の数は常に 1 であり、その値はフォーム内のビューの名前である必要があります。 |
重要 : |
---|
このメンバは、現在開いているフォームと同じドメイン内で実行されているフォーム、またはドメインを越えたアクセス許可を付与されているフォームだけがアクセスできます。 |
例
次の例では、XDocument オブジェクトの SetDataVariable メソッドを使用して、最初の変数の値を設定しています。
thisXDocument.SetDataVariable(1, "View 2");
関連項目
参照
_XDocument2 インターフェイス
_XDocument2 のメンバ
Microsoft.Office.Interop.InfoPath.SemiTrust 名前空間