A
Alan GW
Hi,
(MS Project Standard 2003)
I want to programmatically set the Text1 field for all assignments,
including those that are unassigned. (I might have thought there's no such
thing as an unassigned assignment, but if you add column Text1 to 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.)
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?
Many thanks in advance for replies
Alan.
ps to clarify further, 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
End If
Next myTAsk
(Obviously for real I'm not setting these all to the same value.......)
(MS Project Standard 2003)
I want to programmatically set the Text1 field for all assignments,
including those that are unassigned. (I might have thought there's no such
thing as an unassigned assignment, but if you add column Text1 to 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.)
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?
Many thanks in advance for replies
Alan.
ps to clarify further, 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
End If
Next myTAsk
(Obviously for real I'm not setting these all to the same value.......)