_XDocument3.GetWorkflowTemplates 方法

定义

获取一个对当前表单的 Microsoft.Office.Core.WorkflowTemplates 集合的引用。

public:
 System::Object ^ GetWorkflowTemplates();
public object GetWorkflowTemplates ();
abstract member GetWorkflowTemplates : unit -> obj
Public Function GetWorkflowTemplates () As Object

返回

一个 Microsoft.Office.Core.WorkflowTemplates 集合,其中包含当前表单的所有 Microsoft.Office.Core.WorkflowTemplate 对象。

示例

以下示例使用 GetWorkflowTemplates 方法显示与当前表单关联的工作流模板的数目。

此示例要求在表单代码模块的声明部分中使用 Microsoft.Office.Core 命名空间的 usingImports 指令。

_XDocument3 thisDoc = (_XDocument3)thisXDocument;
WorkflowTemplates myWorkflowTemplates = 
   (WorkflowTemplates)thisDoc.GetWorkflowTemplates();

int workflowTemplatesCount = myWorkflowTemplates.Count;

thisXDocument.UI.Alert("Get " + workflowTemplatesCount.ToString() + " 
   workflow templates.");
Dim thisDoc As _XDocument3 = DirectCast(_
   thisXDocument, _XDocument3)
Dim myWorkflowTemplates As WorkflowTemplates = _
   DirectCast(thisDoc.GetWorkflowTemplates(), WorkflowTemplates)

Dim workflowTemplatesCount As Integer = myWorkflowTemplates.Count

thisXDocument.UI.Alert("Get " & workflowTemplatesCount.ToString() & " _
   workflow templates.")

以下示例使用 GetWorkflowTemplates 方法显示与当前表单关联的工作流模板的数目。

此示例要求在表单代码模块的声明部分中使用 Microsoft.Office.Core 命名空间的 usingImports 指令。

_XDocument3 thisDoc = (_XDocument3)thisXDocument;
WorkflowTemplates myWorkflowTemplates = 
   (WorkflowTemplates)thisDoc.GetWorkflowTemplates();

int workflowTemplatesCount = myWorkflowTemplates.Count;

thisXDocument.UI.Alert("Get " + workflowTemplatesCount.ToString() + " 
   workflow templates.");
Dim thisDoc As _XDocument3 = DirectCast(_
   thisXDocument, _XDocument3)
Dim myWorkflowTemplates As WorkflowTemplates = _
   DirectCast(thisDoc.GetWorkflowTemplates(), WorkflowTemplates)

Dim workflowTemplatesCount As Integer = myWorkflowTemplates.Count

thisXDocument.UI.Alert("Get " & workflowTemplatesCount.ToString() & " _
   workflow templates.")

注解

重要说明:若要使 GetWorkFlowTemplates 方法正常工作,必须从 Visual Studio 2012) “添加引用”对话框的 COM 选项卡中建立对 Microsoft Office 14.0 对象库 (的引用。 这将建立对包含 WorkflowTemplates 类的 Microsoft.Office.Core 命名空间的引用。

由于 GetWorkflowTasks 方法对 Microsoft InfoPath 不熟悉,因此必须声明并强制转换为 _XDocument3 类型才能访问此方法。 有关详细信息,请参阅如何:使用与 InfoPath 2003 不兼容的对象模型成员。

重要说明:此成员只能由已配置为使用“表单选项”对话框的“安全与信任”类别以完全信任方式运行的表单模板打开的表单访问。 此成员要求直接调用方的完全信任并且不能由部分信任的代码使用。 有关更多信息,请参阅 MSDN 上的“使用部分信任的代码中的库”。

适用于