Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UniqueID for a Task 1

Status
Not open for further replies.

laperouse

MIS
Oct 14, 2003
9
US
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?
 
I'm not quite sure what you are trying to do - see the Unique identifier (you can, see below) or are you trying to generate it? (you can't)

The Unique ID is a task field that can be inserted into any of your Task tables. (Point to the Table Headers, Right click and choose Insert Column)

The Unique ID is generated by MS Project when a task is created and does not change, even when tasks are inserted or deleted - so the numbers will very likely appear out of order.

You may be getting the error because you can't change the values in the field.

Hope this helps.
Jan
 
Jan,

Thanks for responding...I am not trying to generate the UniqueID. I want to get the UniqueID for a task. Would you know how to do that? Like I said earlier, I have tried a few ways to get it, but I have received an error.

Any help will be greatly appreciated.

Thanks,
Lori
 
Lori:

When you are in the project file - if you are in the Gantt chart view, the left side of the screen is called a table. You can insert the column "Unique ID" into the table (as I described above) and it will display the Unique ID for each task.

If that isn't what you are looking for - please describe in more detail.

Jan

 
Jan,

Thanks for all of your help...I figured out how to do what I wanted. Thanks again!

Lori
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top