C
Chris Clement
I am opening a project...
proj = new Microsoft.Office.Interop.MSProject.ApplicationClass();
proj.Alerts(false);
proj.DisplayAlerts = false;
proj.DisplayScheduleMessages = false;
object oMissing = Missing.Value;
projFound = proj.FileOpen(strProject, //Name
false, //read only
oMissing, //Merge
oMissing, //TaskInformation
oMissing, //Table
oMissing, //Sheet
true, //NoAuto
"sa", //UserID
"password", //DataBase Password
"MSProject.ODBC", //FormatID
oMissing, //Map*-
PjPoolOpen.pjDoNotOpenPool, //OpenPool
"password", //Password
oMissing, //WriteResPassword
true, //IgnoreReadOnlyRecommended
oMissing //XMLName
);
....set the field values...
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualStart,
tbActStart.Text);
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualFinish,
tbActFinish.Text);
.....setting some "options"...
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing);
proj.OptionsWorkgroup(PjWorkgroupMessages.pjWorkgroupViaWeb,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, false, true,
oMissing, true, true, oMissing, oMissing, oMissing);
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);
...and then calculating and saving...
proj.CalculateProject();
proj.PublishNewAndChangedAssignments(false,
PjPublishScope.pjPublishScopeAll, false, oMissing);
proj.FileSave();
proj.FileExit(PjSaveType.pjDoNotSave);
....Everything seems to be working except that the Res_Euid field in the
MSP_Resources table is set to null. Since we are using this resource
reference to determine if a user has permissions to edit the schedule,
setting this reference to null is preventing the user (Resource) from doing
so.
What am I doing that is changing the value in this field?
Thanks.
Chris
proj = new Microsoft.Office.Interop.MSProject.ApplicationClass();
proj.Alerts(false);
proj.DisplayAlerts = false;
proj.DisplayScheduleMessages = false;
object oMissing = Missing.Value;
projFound = proj.FileOpen(strProject, //Name
false, //read only
oMissing, //Merge
oMissing, //TaskInformation
oMissing, //Table
oMissing, //Sheet
true, //NoAuto
"sa", //UserID
"password", //DataBase Password
"MSProject.ODBC", //FormatID
oMissing, //Map*-
PjPoolOpen.pjDoNotOpenPool, //OpenPool
"password", //Password
oMissing, //WriteResPassword
true, //IgnoreReadOnlyRecommended
oMissing //XMLName
);
....set the field values...
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualStart,
tbActStart.Text);
proj.Projects[strProject].Tasks[taskID].SetField(PjField.pjTaskActualFinish,
tbActFinish.Text);
.....setting some "options"...
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing);
proj.OptionsWorkgroup(PjWorkgroupMessages.pjWorkgroupViaWeb,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, false, true,
oMissing, true, true, oMissing, oMissing, oMissing);
proj.OptionsSchedule(false, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing);
...and then calculating and saving...
proj.CalculateProject();
proj.PublishNewAndChangedAssignments(false,
PjPublishScope.pjPublishScopeAll, false, oMissing);
proj.FileSave();
proj.FileExit(PjSaveType.pjDoNotSave);
....Everything seems to be working except that the Res_Euid field in the
MSP_Resources table is set to null. Since we are using this resource
reference to determine if a user has permissions to edit the schedule,
setting this reference to null is preventing the user (Resource) from doing
so.
What am I doing that is changing the value in this field?
Thanks.
Chris