Set Field Value to Task Collection?

J

JJ

Is there a way to set a value for a single field, such as Flag1 = Yes,
to an entire Task Collection without looping through the Task
Collection?
 
J

John

JJ said:
Is there a way to set a value for a single field, such as Flag1 = Yes,
to an entire Task Collection without looping through the Task
Collection?

JJ,
Yes, as a matter of fact you can and I often use this process in my
macros. The trick is to use foreground processing. Select the entire
column of the desired field, (SelectTaskColumn), and then use the
FillDown Method. You must of course set the desired value into the first
column element so there is something to fill down.

As a side, I often use this approach in conjunction with a filter when I
need to set or reset the data in a particular field for all tasks in a
selected set.

Even though this approach uses foreground processing, I find it is much
faster than looping through all tasks, particularly for larger files.

Hope this helps.

John
Project MVP
 
J

John

Never even thought of that!

Thanks for correcting me. JJ -- apologies for my wrong answer.

Stephen,
No problem. I sure enough get it wrong from time to time and thankfully
someone, usually a fellow MVP, is there to correct the error.

John
 
J

JJ

Thank you, John. Actually, I discovered this on my own before I read
your answer. It seems somewhat of a brute force method of doing what I
need to do but it is much faster.

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top