Udostępnij za pośrednictwem


WorkbookBase.GetWorkflowTemplates Metoda

Definicja

Zwraca kolekcję szablonów przepływów pracy dla skoroszytu.

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

Zwraca

Kolekcja Microsoft.Office.Core.WorkflowTemplates zawierająca szablony przepływów pracy dla skoroszytu.

Przykłady

Poniższy przykład kodu przedstawia liczbę szablonów przepływu pracy, które są dostępne dla skoroszytu. Jeśli istnieje co najmniej jeden szablon przepływu pracy, w przykładzie zostanie wyświetlona nazwa i opis każdego szablonu.

Aby uruchomić ten przykład kodu, należy opublikować skoroszyt w witrynie programu Office SharePoint Server.

Ten przykład dotyczy dostosowywania na poziomie dokumentu.

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

Dotyczy