Insert SubProject after Task x? (Linking ConsolidateProjects to Task)

Discussion in 'Project' started by surumadurum, Mar 31, 2016.

  1. surumadurum


    Mar 31, 2016
    Likes Received:

    I have to solve the task of dynamically inserting Sub-Projects into a Master-Project at a specific position - which is under a certain "heading" and after all the already inserted SubProjects.

    Heading A
    Heading Aa
    - Project A1
    - Project A2
    Heading B
    - Project B1

    My problem is that ConsolidateProjects inserts the project at the current cursor position.
    Now I solved it like that:

    - collapse / expand all Tasks so that Headings and Subheadings are visible but all Subtasks of Sub-Projects are hidden
    - iterate through rows with SelectRow, get task-name with ActiveSelection.Tasks(1).Name
    - if it's the right heading, get number of already inserted subprojects with Tasks(from_last_step).OutlineChildren.Count
    - Call ConsolidateProjects
    - Indent the new inserted project to the correct level

    This solution has shown to be very error-prone. The initial indent of the new subproject seems quite random and often the subprojects and up at the wrong position.

    Isn't there any solution like "Insert subproject after Task(x), no matter in which row it is displayed at the moment"?

    Hope somebody has help!
    surumadurum, Mar 31, 2016
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.