Partager via


WorkbookBase.GetWorkflowTasks Méthode

Définition

Retourne la collection de tâches de flux de travail pour le classeur.

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

Retours

Collection Microsoft.Office.Core.WorkflowTasks qui contient les tâches de flux de travail pour le classeur.

Exemples

L’exemple de code suivant affiche le nombre de tâches de flux de travail actuellement associées au classeur. L’exemple itère ensuite chaque tâche de flux de travail, le cas échéant, et affiche certaines propriétés de tâche sélectionnées dans une zone de message.

Pour ajouter des tâches de flux de travail à votre classeur, vous devez publier le classeur sur un site Office Sharepoint Server.

Cet exemple concerne une personnalisation au niveau du document.

private void DisplayWorkflowTasks()
{
    Office.WorkflowTasks tasks = this.GetWorkflowTasks();
    if (tasks.Count > 1) 
    {
        MessageBox.Show("There are " + tasks.Count.ToString() 
            + " workflow tasks.");
    }
    else if (tasks.Count == 1)
    {
        MessageBox.Show("There is " + tasks.Count.ToString() 
            + " workflow task.");
    }
    else if (tasks.Count == 0)
    {
        MessageBox.Show(
            "No workflow tasks are associated with this document.");
    }
    
    foreach (Office.WorkflowTask task in tasks)
    {
        MessageBox.Show( 
            "Workflow Task ID: " + task.Id 
            + "\r\nWorkflow Task Name: " + task.Name 
            + "\r\nAssigned To: " + task.AssignedTo 
            + "\r\nDescription: " + task.Description);
    }
}
Private Sub DisplayWorkflowTasks()
    Dim tasks As Office.WorkflowTasks = Me.GetWorkflowTasks()
    If tasks.Count > 1 Then
        MessageBox.Show("There are " + tasks.Count.ToString() _
                        + " workflow tasks.")
    ElseIf tasks.Count = 1 Then
        MessageBox.Show("There is " + tasks.Count.ToString() _
                        + " workflow task.")
    ElseIf tasks.Count = 0 Then
        MessageBox.Show( _
            "No workflow tasks are associated with this document.")
    End If
    For Each task As Office.WorkflowTask In tasks
        MessageBox.Show( _
            "Workflow Task ID: " + task.Id _
            + vbCrLf + "Workflow Task Name: " + task.Name _
            + vbCrLf + "Assigned To: " + task.AssignedTo _
            + vbCrLf + "Description: " + task.Description)
    Next
End Sub

S’applique à