|
|
|
date: Fri, 3 Oct 2008 13:39:01 -0700,
group: microsoft.public.project.developer
back
Re: Sort versus order tasks are looped over
Jack,
Thanks for the suggestion, switching to SelectAll and ActiveSelection did
the trick!
-- Carl
"Jack Dahlgren MVP" wrote:
> I'd probably build an array or list of tasks, sort it, then loop through it.
> Or you might see what happens if after you sort - you could then do a
> SelectAll then loop through the activeselection.tasks
>
> -Jack Dahlgren
>
> "Carl" wrote in message
> news:BC792A77-B3A9-4386-969F-7EEBF9DC5059@microsoft.com...
> > Here's my code:
> >
> > Sub SortedTaskLoop()
> > Dim Tsk As Task
> > ActiveProject.Tasks.Application.Sort Key1:="Text1", Renumber:=False,
> > Outline:=False
> > For Each Tsk In ActiveProject.Tasks
> > If Not Tsk Is Nothing Then ' test for blank rows
> > Debug.Print Tsk.ID; Tsk.Text1
> > End If
> > Next Tsk
> > End Sub
> >
> > -- Carl
> >
> > "Carl" wrote:
> >
> >> I've got a bit of code that sorts tasks based on Text1, then it loops
> >> over
> >> the tasks looking at all the Text1 fields. After I run the macro I can
> >> examine the schedule and the sort looks correct, everything in
> >> alphabetical
> >> order. But when I loop over the tasks, the Text1 values I get are not
> >> alphabetical (looks like they're in ID order). How do I iterate over all
> >> tasks in Text1 order?
> >>
> >> -- Carl
>
date: Fri, 3 Oct 2008 19:09:00 -0700
author: Carl
|
|