Create an Empty Project File
Code Examples
VSTO
Below is the code to add project file in Microsoft Project
1Project project = this.Application.Projects.Add();
Aspose.Tasks
The
Project class is the core API in Aspose.Tasks used to create, access, and manipulate project data. It exposes the Save()
method, which allows exporting project content to various supported formats such as XML, MPP, PDF, HTML, and others. This method accepts a file name or stream, along with a value from the
SaveFileFormat enumeration to determine the desired output format.
Currently, Aspose.Tasks for .NET supports creating new project files in XML format. The following code snippet demonstrates how to initialize a new project and save it directly to XML:
Below is code sample:
1Project project = new Project();
2
3project.Save("NewProject.xml", Saving.SaveFileFormat.XML);
The resulting NewProject.xml file conforms to the Microsoft Project XML schema and can be loaded back using ProjectReader or opened in Microsoft Project for further editing.