Buster said:
I have tried the code you supplied, but have one question, why does it fail
when I substitute "pjCustomTaskText1" with "pjCustomTaskText&i)" where i is
the variable from the for next counter so that I loop through each of the 1
to 40 fields.
Jeff,
It fails because the argument in the CustomFieldGetName Method is a long
and you are trying to use a string. There are various ways to handle
this.
One method that sometimes works is use the long numerical value. For
example, use 188743731 instead of pjCustomTaskText1. This method works
best if the numerical values for each of the fields of interest are
sequential (or nearly so). Then increment the value to the next field.
Note that the difference isn't always "1" and there may be breaks in the
sequence so those will have to be addressed. Another downside is that by
using the numerical value, it is not obvious which field is being
addressed.
Another method that works is to set up a case statement to change the
long constant each run through the loop. Yes it is a lot of case
statements but it gets the job done.
Hope this helps.
John