Create MS Project Files using C++ – Add Tasks, Resources, or Calenders to Projects

Create MS Project Files in C++

MS Project is a widely used project management software that helps the managers in managing their projects efficiently. It allows to create the tasks, add resources, allocate tasks to resources, monitor the progress, and manage budget-related operations. In this article, you will learn how to embed the project management activities within your C++ applications without MS Project. With the help of code samples, you will learn how to create MS Project files (.mpp/.xml), add tasks, resources, and calendars programmatically using C++. Furthermore, the assignment of tasks to resources in a project will also be demonstrated.

C++ MS Project File Manipulation API

Aspose.Tasks for C++ is a C++ project management API that lets you create, manipulate, export, and convert MS Project files programmatically. The API provides you a complete set of features to create projects, tasks, resources, calendars, and perform other project management activities without MS Project. You can download the complete package of the API from here or install it using NuGet.

Create MS Project Files (.mpp) using C++

Lets first start by creating an empty project. The following are the steps to create an MS Project (.mpp) file from scratch using Aspose.Tasks for C++.

The following code sample shows how to create an MS Project’s .mpp file using C++.

Add Tasks to Project using C++

Once you have created a project, you can proceed to add tasks to it. You can either create a new project or load an existing MS Project file to add the tasks. The following are the steps to create and add tasks or subtasks to a project.

The following code sample shows how to create and add tasks to a project using C++.

Read more about extended features related to tasks.

Add Resources to Project using C++

Resources are the entities that are supposed to complete the project. Usually, people are referred to as the resources of a project. The following are the steps to create and add resources to a project.

The following code sample shows how to add a resource in a project using C++.

Read more about extended features related to resources.

Assign Project’s Task to Resource using C++

Once you have created the tasks and resources, the next step is to assign each task to a resource that is responsible for its completion. The following are the steps to assign a task to a resource.

The following code sample shows how to assign a task to a resource in a project using C++.

Add Calendars in Project using C++

Calendars are used to create a schedule for the project within the MS Project. Aspose.Tasks for C++ has made it very simple to create a calendar for a project. The following are the steps to create a calendar, add weekdays, and specify the working time.

You can also set the working time for a weekday in the calendar. For this, you can follow the below steps after adding the working days.

The following code sample shows how to create a calendar in a project using C++.

Read more about extended features related to calendars.

Conclusion

In this article, you have learned how to create MS Project files and save them as .mpp or .xml using C++. Furthermore, you have learned how to add tasks, resources, resource assignments, and calendars within a project programmatically. You can also explore the documentation for the extended features of Aspose.Tasks for C++ to further enhance the project management capabilities within your applications.

See Also