Expand Minimize

DocumentBase.GetWorkflowTemplates Method

Returns the workflow templates that are attached to the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public WorkflowTemplates GetWorkflowTemplates()

Return Value

Type: Microsoft.Office.Core.WorkflowTemplates
A Microsoft.Office.Core.WorkflowTemplates collection that contains the workflow templates that are attached to the document.

The following code example displays the number of workflow templates that are available for the document. If one or more workflow templates exist, the example displays the name and description of each template.

To run this code example, you must publish the document to an Office Sharepoint Server site. To use this example, run it from the ThisDocument class in a document-level project.

private void DisplayWorkflowTemplates()
    Office.WorkflowTemplates workflowTemplates = 
    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\n"
            + "Description: " + template.Description);
    if (workflowTemplates.Count > 0)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft