共用方式為


WorkbookBase.GetWorkflowTemplates 方法

定義

傳回活頁簿工作流程範本的集合。

public:
 Microsoft::Office::Core::WorkflowTemplates ^ GetWorkflowTemplates();
public Microsoft.Office.Core.WorkflowTemplates GetWorkflowTemplates ();
member this.GetWorkflowTemplates : unit -> Microsoft.Office.Core.WorkflowTemplates
Public Function GetWorkflowTemplates () As WorkflowTemplates

傳回

Microsoft.Office.Core.WorkflowTemplates 集合,包含活頁簿的工作流程範本。

範例

下列程式代碼範例會顯示活頁簿可用的工作流程範本數目。 如果存在一或多個工作流程範本,此範例會顯示每個範本的名稱和描述。

若要執行此程式代碼範例,您必須將活頁簿發佈至 Office SharePoint Server 網站。

此範例適用於檔層級自定義。

private void DisplayWorkflowTemplates()
{
    Office.WorkflowTemplates workflowTemplates = 
        this.GetWorkflowTemplates();
    MessageBox.Show("Number of workflow templates found: " 
        + workflowTemplates.Count.ToString());
    StringBuilder sb = new StringBuilder();
    sb.Append("Workflow Template List\r\n");
    foreach (Office.WorkflowTemplate template in workflowTemplates)
    {
        sb.Append("\r\n" + template.Name + " Template" 
            + "\r\nDescription: " + template.Description);
    }
    if (workflowTemplates.Count > 0)
    {
        MessageBox.Show(sb.ToString());
    }
}
Private Sub DisplayWorkflowTemplates()
    Dim workflowTemplates As Office.WorkflowTemplates = _
        Me.GetWorkflowTemplates()
    MessageBox.Show("Number of workflow templates found: " _
        + workflowTemplates.Count.ToString())
    Dim sb As StringBuilder = New StringBuilder()
    sb.Append("Workflow Template List" + vbCrLf)
    For Each template As Office.WorkflowTemplate In workflowTemplates
        sb.Append(vbCrLf + template.Name + " Template" + vbCrLf _
            + "Description: " + template.Description)
    Next
    If workflowTemplates.Count > 0 Then
        MessageBox.Show(sb.ToString())
    End If
End Sub

適用於