我有一个 MSProject 项目,我想更改正在使用的日历。问题是我找不到这个属性。
在这里我展示我的代码:
Microsoft.Office.Interop.MSProject.Application app = new Microsoft.Office.Interop.MSProject.Application();
app.FileOpenEx(
Server.MapPath("") + "\\sample.mpp",
false,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
PjPoolOpen.pjPoolReadWrite,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing);
pj=app.ActiveProject;
//"proyecto" is an entity
//app.GlobalBaseCalendars has all calendars
foreach (Microsoft.Office.Interop.MSProject.Calendar calendar in app.GlobalBaseCalendars)
{
if (calendar.Name == "Noche")
{
pj.Calendar.index? GUID? ...= // All properties are read-only
}
}
如何设置 的值pj.Calendar
?