Método Task.UnlinkSuccessors (Project)

Remove uma ou mais sucessoras da tarefa.

Sintaxe

expression. UnlinkSuccessors( _Tasks_ )

Expressão Uma variável que representa um objeto Task .

Parâmetros

Nome Obrigatório/Opcional Tipo de dados Descrição
Tarefas Obrigatório Object Pode ser um objeto Task ou Tasks, que especifica uma ou mais tarefas removidas como sucessoras.

Valor de retorno

Nothing

Exemplo

O exemplo a seguir remove a sucessora especificada de cada uma das tarefas no projeto ativo.

Sub RemoveSuccessor() 
    Dim Entry As String  ' Successor specified by user 
    Dim SuccTask As Task ' Successor task object 
    Dim T As Task        ' Task object used in For Each loop 
    Dim S As Task        ' Successor (task object) used in loop 
 
    Entry = InputBox$("Enter the name of a successor to unlink from every task in this project.") 
    Set SuccTask = Nothing 
 
    ' Look for the name of the successor in tasks of the active project. 
    For Each T In ActiveProject.Tasks 
        If T.Name = Entry Then 
            Set SuccTask = T 
            Exit For 
        End If 
    Next T 
 
    ' Remove the successor from every task in the active project. 
    If Not (SuccTask Is Nothing) Then 
        For Each T In ActiveProject.Tasks 
            For Each S In T.SuccessorTasks 
                If S.Name = Entry Then 
                    T.UnlinkSuccessors SuccTask 
                    Exit For 
                End If 
            Next S 
        Next T 
    End If 
End Sub

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.