Hi, (MS Project 2003)
I want to programmatically set the Text1 field for all assignments, including those that are unassigned. (You might think there's no such thing as an unassigned assignment, but if you add column Text1 to, say the resource usage view you will find that you can enter values for all assignments, including those where the resource is unassigned, and all the values are retained. Further, if you export the whole project to Access, you will find that there are rows for these in the MSP_ASSIGNMENTS table, with RES_UID=-65535).
As far as I can see, the only way in the object model to get at an assignment object is via task or via resource. But mytask.assignments only includes items where resource has been assigned, and (hardly surprisingly) there's no resource object for the null resource.
So, the question:
Is it posible to access this data via the object model, and if so how? If not, then is there some other way?
It occurs to me that it might work to (programmatically) assign a dummy resource to all unassigned tasks, set the field, and then explicitly reset the resource ID in the assignment object to the unassigned value. But I think this might have unpleasant side effects.
Many thanks for all suggestions,
Alan.
ps if it helps to be clear, the following code successfully sets the text1 field for all assignments which do have resource, but I want to do the same where the resource usage view shows resource as Unassigned.
Dim myTask as Task
Dim myAssignment as Assignment
For Each myTask in ActiveProject.Tasks
If Not myTask Is Nothing Then
For Each myAssignment in myTask.Assignments
myAssignment.Text1 = "some specific value"
Next myAssignment
Next myTAsk
(Obviously for real I'm not setting these all to the same value.......)