Project.GetTaskIndexByGuid method (Project)

Returns the local task identification number (ID) for the specified task.

Syntax

expression. GetTaskIndexByGuid( _TaskGuid_ )

expression A variable that represents a Project object.

Parameters

Name Required/Optional Data type Description
TaskGuid Required String The GUID of the task.

Return value

Long

Remarks

The local task ID is the task index, which changes if the order of the task changes.

Example

If the ID of the specified task is 6, the following function returns the value 6.

Function TestTaskId() As Long 
 TestTaskId = ActiveProject.GetTaskIndexByGuid("341A479D-73A5-4209-9366-8EA2B836255B") 
End Function

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.