There has been a number of people asking how to read assignment enterprise custom field values with VBA. In fact, we ran into this issue internally with our dogfood efforts and fixed it in SP1. So, if you need to get/set assignment custom field values, the first step is to download SP1:
Once you have SP1 installed, it is fairly easy to read assignment enterprise custom fields. When you read and set task and resource enterprise custom fields, you use the GetField and SetField methods in VBA. To read and set the assignment values you don't use the GetField and SetField, but instead use the name of the enterprise custom field as a property of the assignment. There are a couple of caveats, however:
Here is a short example. Suppose your custom Field name is "ecfName", here is how you would read it:
For Each T in ActiveProject.Tasks
If Not (T is Nothing) Then
For Each A in T.Assignments
assignCFVal = A.ecfName
PingBack from http://msdnrss.thecoderblogs.com/2008/01/23/
will be implemented function SetField & GetField for assignment?
Thanks for the tip - works great for enterprise custom fields without spaces in their names.
I have ECFs named "Estimated Start" and "Estimated Finish" -- how can I get the assignment values for these?
Thanks in advance.