Adding Resources to Microsoft Project (MPP/XML) files
Contents
[
Hide
Show
]Overview
Resources are actually the people included in the project plan but resources can be people, equipment, facilities, funding, or anything required for the completion of a project task. In Microsoft Project, the resources tab provides various features to manage resources for the project. Aspose.Tasks for C++ API provides Rsc class to represent Resource properties. The Resource class allows adding a new resource to the project.
Add Resources to Your Project
The code example given below demonstrates how to add a resource.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create project instance
5System::SharedPtr<Project> project = System::MakeObject<Project>();
6
7// Add resources
8System::SharedPtr<Resource> rsc1 = project->get_Resources()->Add(u"Rsc");
9
10// Save project as XML
11project->Save(dataDir + u"CreateResources_out.xml", Aspose::Tasks::Saving::SaveFileFormat::XML);