how to know a task is expanded or not

M

Mohan

hello,
is there a way to know whether a task is expanded or collapased using VB.
thanks in advance.
Kind Regards,
Mohan
 
J

John

Mohan said:
hello,
is there a way to know whether a task is expanded or collapased using VB.
thanks in advance.
Kind Regards,
Mohan

Mohan,
I answered this on the regular newsgroup - before I saw your multiple
postings.

John
Project MVP
 
M

Mohan

Hi,
Let me explain you my actual requirement.
I have to change the text color of Start and Finish fields of each and every
task in a ms project plan.
For that reason i am using OutlineShowAllTasks method immediately after
opening the ms project plan.
The reason behind it is i am calling selectTaskField method for that
respective task.
As the SelectTaskFiled expects the row, column values, i am forced to
collapse the mpp structure.
So what i planned to do now is :
1. Memorise each and every task status i.e whether the task is expanded or
not.
2. apply OutlineShowAllTasks
3. Do the processing using SelectTaskFiled ( at this point task id and row
number both will match if we have applied OutlineShowAllTasks)
4. Update the text color of Start and Finish columns
5. By making use of the memorized task's status which is in step 1, arrange
the tasks again in the same fashion as it were before collapsing the
structure using OutlineShowAllTasks.

This is all about my requirements.
Please suggest me how should i proceed to achieve the same.
Thanks in advance for your suggestions.
Best Regards,
Mohan
 
M

Mohan

Hi John,
Let me explain you my actual requirement.
I have to change the text color of Start and Finish fields of each and every
task in a ms project plan.
For that reason i am using OutlineShowAllTasks method immediately after
opening the ms project plan.
The reason behind it is i am calling selectTaskField method for that
respective task.
As the SelectTaskFiled expects the row, column values, i am forced to
collapse the mpp structure.
So what i planned to do now is :
1. Memorise each and every task status i.e whether the task is expanded or
not.
2. apply OutlineShowAllTasks
3. Do the processing using SelectTaskFiled ( at this point task id and row
number both will match if we have applied OutlineShowAllTasks)
4. Update the text color of Start and Finish columns
5. By making use of the memorized task's status which is in step 1, arrange
the tasks again in the same fashion as it were before collapsing the
structure using OutlineShowAllTasks.

This is all about my requirements.
Please suggest me how should i proceed to achieve the same.
Thanks in advance for your suggestions.
Best Regards,
Mohan
 
J

John

Mohan said:
Hi John,
Let me explain you my actual requirement.
I have to change the text color of Start and Finish fields of each and every
task in a ms project plan.
For that reason i am using OutlineShowAllTasks method immediately after
opening the ms project plan.
The reason behind it is i am calling selectTaskField method for that
respective task.
As the SelectTaskFiled expects the row, column values, i am forced to
collapse the mpp structure.
So what i planned to do now is :
1. Memorise each and every task status i.e whether the task is expanded or
not.
2. apply OutlineShowAllTasks
3. Do the processing using SelectTaskFiled ( at this point task id and row
number both will match if we have applied OutlineShowAllTasks)
4. Update the text color of Start and Finish columns
5. By making use of the memorized task's status which is in step 1, arrange
the tasks again in the same fashion as it were before collapsing the
structure using OutlineShowAllTasks.

This is all about my requirements.
Please suggest me how should i proceed to achieve the same.
Thanks in advance for your suggestions.
Best Regards,
Mohan

Mohan,
If all you need to do is to change the font color of all performance
tasks (i.e. subtasks under summary lines), then there is an easier way
to do it. Simply filter for all non-summary lines, select the Start and
FInish fields, set the desired font color for the first one and then do
a fill down.

If this doesn't do what you want, I guess I need a clearer explanation
of what you want to do.

John
Project MVP
 
M

Mohan

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.
 
J

John

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,
Unfortunately we must have a language problem because I'm having trouble
understanding what you have and what you need. I am also not familiar
with ClearQuest. What is it?

As far as wanting to leave the project plan in whatever state it was
when it was opened, I save the CurrentView before I start processing in
my macros. Then when the macro is finished, I recall the saved view.

John
Project MVP
 
J

John

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
 

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