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