I am writing a macro to pull information from a text file downloaded from Dell's website to insert into MS Project 2003. I am trying to get the TaskID or the Unique Identifier of a task after it has been added. Here is the code I am using:
'This adds the DetailInfo, which is a string, as a Task to the Project
ActiveProject.Tasks.Add (DetailInfo)
'I have tried the following scenarios to try to retrieve the uniqueID of the task entered via the code above.
ActiveSelection.Tasks.Application.ActiveCell.Task.UniqueID
ActiveProject.Tasks.UniqueID
Both give me the error: "Invalid use of property."
Any ideas?
Also, can I assign a variable to hold the uniqueID of the task?
'This adds the DetailInfo, which is a string, as a Task to the Project
ActiveProject.Tasks.Add (DetailInfo)
'I have tried the following scenarios to try to retrieve the uniqueID of the task entered via the code above.
ActiveSelection.Tasks.Application.ActiveCell.Task.UniqueID
ActiveProject.Tasks.UniqueID
Both give me the error: "Invalid use of property."
Any ideas?
Also, can I assign a variable to hold the uniqueID of the task?