Writing Updated Resource Data Back to MPP files

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:

  1. Create an instance of the Project Reader.
  2. Read the source MPP file.
  3. Add resources to the project.
  4. Update existing resource data.
  5. 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);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.