none
Telling when user changes to manually scheduled tasks by default RRS feed

  • Question

  • I'm developing a client level AddIn for Microsoft Project 2010 using VSTO and I need to be able to determine when the user changes the option to have project create new tasks as either auto scheduled or manually scheduled.  I know how to determine this by using the NewTasksCreatedAsManual Property found on the project object.  I would like to be able to be alerted when the user changes this option via some event.  

    If anyone knows how this may work please let me know and thanks in advance.

    Thursday, July 7, 2011 12:32 PM

Answers

All replies

  • There is no event for changing options like this that I am aware of. You will have to test for it whenever your add-in is run if it's that important.

    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management
    • Marked as answer by Thomas_Bell Friday, July 8, 2011 7:34 PM
    Thursday, July 7, 2011 11:20 PM
    Moderator
  • To follow up on Rod's answer ... you'll need to use code in the Change Event, so something like this:

     

    Private Sub Project_Change(ByVal pj As Project)
    If Application.SetTaskMode Then
    'True (manually scheduled)
    'Do this stuff
    Else
    'False (autoscheduled)
    'Do the other stuff
    End If
    End Sub

    This code executes every time any change is made to your project.

    There is aslo at Project_Calculation method that executes each time the application calculates the schedule.  That option gives you a little more control

    From the Help:

    expression.SetTaskMode(Manual, IsStickyDates)

    expression An expression that returns an Application object.

    Parameters

     

    Name Required/Optional Data Type Description
    Manual Optional Boolean If true, changes the selected tasks to manually scheduled. If false, changes the tasks to automatically scheduled.
    IsStickyDates Optional Boolean If true, when a manually scheduled task is changed to automatically scheduled, the constraint type is set to Start No Earlier Than and the constraint date is set to the previous start date.

     

    Return Value
    Boolean


    If you feel this post answered the question, please vote for it. I am also available here:
    msprojectblog.com
    Friday, July 8, 2011 4:11 PM
    Moderator
  • Thanks for your answer Jim. Unfortunately the project changed event and the project calculate event are not fired when this option is changed. But thanks again for your help in this matter.
    Friday, July 8, 2011 7:34 PM
  • Thanks I was afraid that was the answer. Thanks for your reply.
    Friday, July 8, 2011 7:34 PM