Mohan said:
Hi John,
Here i am providing you the actual requirements.
We use are using ClearQuest tool which is used to maintain defects in a
project.
Project managers will maintain the same defects related information in MS
Project plans.
In this case information in ClearQuest tool is the master database.
In ms project plans i have one field which will let me know the ClearQuest
ID of the respective each and every task.
So i am trying to synchronise the MS project plan will the data from
ClearQuest.
In that i have to change the font color of Start and Finish columns by
comparing the dates of ClearQuest record with the respective task in ms
project plan.
Actually i am achieving the same thing.
but to do it i am collapsing the total plan to do the above mentioned as i
am using SelectTaskField method during font color change.
The ms project plan orginator dont want to change the structure of the ms
project plan after the sync mechanism i.e(what ever the task are expanded
should be expanded, what ever the tasks are not expanded should not be
expanded.
Could you please provide how to proceed to achieve the same.
Best Regards,
Mohan.
Mohan,
Since my last response I've given this a little more thought. I realized
that saving the current view will not get what you want since font
formatting is view specific - sorry, my error.
I also mentioned that I was having trouble understanding your
requirements. The part about "maintain defects" really confuses me since
defects are normally something to be eliminated so trying to maintain
(i.e. keep) them just doesn't make sense. However, if I step back from
that and try to understand what you want here is what I have. You have
one or more project files that are maintained by someone else (i.e.
project plan originator). That person has saved the file in a particular
state of expanded and collapsed summary lines. You need to do a
comparison of that file with some data from ClearQuest. Based on that
comparison you need to change the font color of the Start and Finish
fields on selected tasks. Finally you need to expand and collapse the
file in the same way it was before you ran your macro and then save the
file in that state. Is this basically correct?
Assuming my understanding is correct, here is what I suggest. First I
would not use the task ID for the comparison. Instead use the Unique ID
field. Task IDs can change, unique IDs do not. Given that, here is an
outline of the basic process I would use to "color code" the file.
1. If there is a possibility the file was saved in a sorted state, use a
spare number field to fill with a temporary continuous sequence of
numbers. This will be used later to re-set the sort if necessary.
2. Loop through all tasks of the file. Wherever there is a break in the
ID sequence, store that task ID in an array. The data in this array will
be used later to re-establish the file format (i.e. expand/collapse).
Note: this is the task ID, not the unique ID.
3. Expand the whole file, make sure the "all tasks" filter is applied
and the sort sequence is by unique ID. Here is where you use the Unique
ID field for the compare.
4. Run your comparison and use a spare flag field to identify each task
row that will require a font color change. You will use this flag field
later to actually change the font color as a group rather than changing
the font color on the fly during the comparison.
5. When the comparison is complete, filter on the flag set in step 5,
change the font color of the first filter row and then do a fill down.
6. Sort on the temporary number field to replicate the original sort
7. Use the array data from step 3 to expand and collapse summary lines
to replicate the original file structure
8. Clear the temporary number field and spare flag field
9. Save the updated file.
Hope this helps.
John
Project MVP