Compartir por


Método Task.UnlinkSuccessors (Project)

Quita una o más sucesoras de la tarea.

Sintaxis

expresión. UnlinkSuccessors( _Tasks_ )

expresión Variable que representa un objeto Task .

Parameters

Nombre Obligatorio/opcional Tipo de datos Descripción
Tasks Obligatorio Object Puede ser un objeto Task o Tasks, que especifica una o varias tareas que se han quitado como sucesoras.

Valor devuelto

Nothing

Ejemplo

En el ejemplo siguiente se quita la sucesora especificada de todas las tareas del proyecto activo.

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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.