Writing Updated Resource Data Back to MPP files
Contents
[
Hide
Show
]Aspose.Tasks for .NET provides lets you update a Microsoft Project MPP file’s resource data and save it data back to the MPP file.
Writing Updated Resource Data back to the MPP file
The code snippet in this article opens a source MPP file that has one resource. It then updates the data of the resource and adds several new resources. The steps involved in this activity are:
- Create an instance of the Project Reader.
- Read the source MPP file.
- Add resources to the project.
- Update existing resource data.
- Save the project using the Project Writer.
The following piece of code demonstrates this by an example.
1Project project = new Project("New Project.mpp");
2
3// Add resource and set some properties
4Resource resource = project.Resources.Add("Rsc");
5resource.Set(Rsc.StandardRate, 30);
6resource.Set(Rsc.OvertimeRate, 45);
7resource.Set(Rsc.Group, "Workgroup1");
8
9project.Save("UpdateResourceData_out.mpp", SaveFileFormat.MPP);