MSP Professional Version 2007 SP1 Tasks collection RRS feed

  • Question

  • I'm a bit rusty on MSP, but I am experienced, and I am fluent in vba....

    I'm trying to update an Access database with fields from an MSP project. My customer is not sophisticated, treats the project sort of like Excel on steroids, and doesn't want to change....I know, I know....

    So, having collapsed the project to outline level 1 and sorted it by a (text10) custom field, I want to interrogate each level one task in that "collection" to extract a couple dates, etc. I know how to extract the dates, etc., but I'm having trouble narrowing my loop to the "collection" that's on the screen. The project has thousands of tasks, and I'm only interested in a hundred of them. How can I refer to only the tasks that are at outline level 1, and in the order they're shown on the screen (now that I've sorted them....) It's got to be a collection I'm missing, but when I go through the activeproject.tasks collection, I get all the tasks, and not in the right order.

    I'm sure it's something simple, ideas?


    Monday, October 4, 2010 3:15 PM


  • For outline level 1 tasks you can use

    if task.outlineleve = 1 then

    'what you want to do

    end if


    For the sort order:

    You can either sort and permanently renumber the tasks - this will reset their to be sequential

    You can filter the view to show only outline level 1 tasks and then SelectAll then work with ActiveSelection

    for each task in activeselection.tasks ...

    Or you can sort the tasks later according to whatever sort criteria you are using.

    Jack Dahlgren blogs at:
    Project and Retrovention
    and rarely Twitter
    • Marked as answer by JimS-Indy Monday, October 4, 2010 3:57 PM
    Monday, October 4, 2010 3:33 PM