none
Need working non-working days information for project .. RRS feed

  • Question

  • I need to know for a given project on project Server which day is non work day, which day is work day.  Along with this i also need for work day what time is working time. Such as 8AM to 4PM, or (8AM to 12PM and 1PM to 5PM). 

    All this needs to be retrieved using PSI.

    This is pretty urgent requirement. Any help would be highly appreciated.

    Friday, January 14, 2011 12:24 PM

All replies

  • As far as I know the workday functionality is not (yet) available through the PSI.

    You can access the infor using an add-in:

          MSProject.Project activeProject = Globals.ThisAddIn.Application.ActiveProject;
          //Index is the weekday index number, three-letter abbreviation of the day name, or PjWeekday constant
          //activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Working = true;
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].set_Working(true);
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift1.Start = new DateTime(2011, 1, 1, 14, 0, 0);
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift1.Finish = new DateTime(2011, 1, 1, 15, 0, 0);
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift2.Clear();
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift3.Clear();
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift4.Clear();
          activeProject.Calendar.WeekDays[MSProject.PjWeekday.pjMonday].Shift5.Clear();
    
    Hope this can help you get a step further with your challenge.
    Regards, J
    Tuesday, January 25, 2011 3:10 PM