_XDocument2.GetDataVariable 方法 (Int32)

获取指定变量的值,该变量是作为处理指令属性存储在表单的基础 XML 文档中的预定义变量。

命名空间:  Microsoft.Office.Interop.InfoPath.SemiTrust
程序集:  Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)

语法

声明
Function GetDataVariable ( _
    lVariableNumber As Integer _
) As String
用法
Dim instance As _XDocument2
Dim lVariableNumber As Integer
Dim returnValue As String

returnValue = instance.GetDataVariable(lVariableNumber)
string GetDataVariable(
    int lVariableNumber
)

参数

返回值

类型:System.String
指定变量的值,该变量是作为处理指令属性存储在表单的基础 XML 文档中的预定义变量。

实现

_XDocument.GetDataVariable(Int32)

备注

如果没有定义变量或变量为空,则 GetDataVariable 方法将返回空字符串。若要设置变量,请使用 SetDataVariable 方法。

备注

InfoPath 只支持使用 initialView 变量,该变量用于指定在表单打开时所显示的初始视图。该变量的数目始终为 1,且变量值必须为表单内某个视图的名称。

重要

此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。

示例

在以下示例中,XDocument 对象的 GetDataVariable 方法用于返回第一个变量的值:

string variable1;
variable1= thisXDocument.GetDataVariable(1);

另请参阅

引用

_XDocument2 接口

_XDocument2 成员

GetDataVariable 重载

Microsoft.Office.Interop.InfoPath.SemiTrust 命名空间