1

我有一个 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

4

1 回答 1

0

这是项目属性是只读的许多情况之一,设置它的方法是使用应用程序的方法:

app.ProjectSummaryInfo(
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       Type.Missing,
                       "Noche",
                       Type.Missing,
                       Type.Missing,
                       Type.Missing);
于 2013-05-15T19:11:05.273 回答