Thoroughly Collapsing Subtasks

B

bstobart

I'm interested in a faster way to completely collapse the subtasks of a
project. Assuming that the subtasks are fully expanded (say to level 9), I
want to get to the state of having all collapsed. If I use the following
command:

OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel1

the result seems to be that the interim subtasks are not collapse, such that
if you then manually expand one level, you end up with all of the lower
levels also expanded. I don't want that. I want to be able to gradually
expand back to being fully expanded without skipping any levels. As a
workaround, I've implemented the following:

OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel9
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel8
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel7
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel6
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel5
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel4
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel3
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel2
OutlineShowTasks OutlineNumber:=pjTaskOutlineShowLevel1

which does exactly what I want, but is rather time consuming, for a large
project.

I presume that there is a faster way to thoroughly collapse all subtasks,
such that when you expand them again, you expand just one level with each
step. Idealy, I'd like a single line of code to do this. I hope my question
is clear.
 
R

Rod Gill

I don't think there is as this mirrors the manual behavior. Do this manually
and you get the same result. VBA tends to coy what happens manually which is
why I think not. One reason is probably what you found: it's slow!

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
B

bstobart

Hmmm...well that's disappointing. I thought this thorough collapsing would
be a feature that others would have asked for previously.

Thanks for your response.
 

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