Show Outline Level - state descriptor available?

G

G Lykos

Greetings!

Would like to check the task outline level being displayed, and restore it
after setting a filter and doing some task manipulations in VBA. Is there a
state descriptor available to VBA that indicates if Outline Level 1, 2, ...,
or ALL is currently being displayed, or do you have to inspect all of the
tasks and infer it?

Thanks,
George
 
J

John

G Lykos said:
Greetings!

Would like to check the task outline level being displayed, and restore it
after setting a filter and doing some task manipulations in VBA. Is there a
state descriptor available to VBA that indicates if Outline Level 1, 2, ...,
or ALL is currently being displayed, or do you have to inspect all of the
tasks and infer it?

Thanks,
George

George,
Unless there is some obscure property I'm not aware of, determining what
is being displayed is not something generally available via VBA. And for
the Outline Level, that makes sense because Summary Lines can be
individually expanded or collapsed thus making a single property for
Outline Level impossible to determine via code. It is similar to font
characteristics - they can't be read directly with VBA but they can be
indirectly determined by following the criteria that set the
characteristic in the first place.

I think your best bet, if you really need to know the Outline Level
displayed, is to loop through all tasks and check for the highest
Outline Level. Again though, due to variability some areas of the file
may be more expanded/collapsed than others.

Hope this helps.
John
Project MVP
 
G

G Lykos

John, thanks for confirming my suspicion.

To illustrate the origin of the question: there are methods, and standard
toolbar buttons, to show all tasks down to Outline Level 1, 2, 3, etc. and
ALL.

I am filtering tasks to locate tasks of interest (some of which may have
been hidden in the current view) to perform a manipulation, and would like
to then return the project to its original displayed form. I can save
Current View and Current Filter at the project level going in and restore
them coming out, but it appears I have no way (other than individually) to
capture and then restore displayed (e.g. visible) tasks - or am I missing
something?

Thanks,
George
 
J

Jan De Messemaeker

Hi,

Select all, run through activeselection.tasks, set a flag for these, after
ending your work apply a filter using the flag set.
A generel way to go back to a previous view situation.
HTH
 
J

John

G Lykos said:
John, thanks for confirming my suspicion.

To illustrate the origin of the question: there are methods, and standard
toolbar buttons, to show all tasks down to Outline Level 1, 2, 3, etc. and
ALL.

I am filtering tasks to locate tasks of interest (some of which may have
been hidden in the current view) to perform a manipulation, and would like
to then return the project to its original displayed form. I can save
Current View and Current Filter at the project level going in and restore
them coming out, but it appears I have no way (other than individually) to
capture and then restore displayed (e.g. visible) tasks - or am I missing
something?

Thanks,
George

George,
I agree with Jan's suggestion. The best way to "capture" the current
displayed tasks is to use the ActiveSelection approach. I'll add just
one thing to Jan's reply. I would clear the flag field before using it
to identify the active tasks just in case that flag is set for some
other reason.

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