Project.Save
Contents
[
Hide
]Save(string, SimpleSaveOptions)
Saves the document to a file using the specified save options.
public void Save(string filename, SimpleSaveOptions options)
| Parameter | Type | Description | 
|---|---|---|
| filename | String | The file name. | 
| options | SimpleSaveOptions | The save options. | 
Examples
Shows how to save project as an MPP file.
var project = new Project();
SimpleSaveOptions options = new MPPSaveOptions();
project.Save(OutDir + "EmptyProjectSaveStream_out.xml", options);
See Also
- class SimpleSaveOptions
 - class Project
 - namespace Aspose.Tasks
 - assembly Aspose.Tasks
 
Save(string, SaveFileFormat)
Saves the project data to the file.
public void Save(string filename, SaveFileFormat format)
| Parameter | Type | Description | 
|---|---|---|
| filename | String | The file name. | 
| format | SaveFileFormat | The save file format. | 
Examples
Shows how to create a project and save it into MPP format without passing of an MPP template file.
var project = new Project();
// The project will be saved into MPP by using internal MPP template.
project.Save(OutDir + "CreateEmptyProjectSaveMPP_out.mpp", SaveFileFormat.Mpp);
See Also
- enum SaveFileFormat
 - class Project
 - namespace Aspose.Tasks
 - assembly Aspose.Tasks
 
Save(string)
Saves the project data to the file in mpp format.
public void Save(string filename)
| Parameter | Type | Description | 
|---|---|---|
| filename | String | The file name. | 
See Also
- class Project
 - namespace Aspose.Tasks
 - assembly Aspose.Tasks
 
Save(Stream, SimpleSaveOptions)
Saves the project to a stream using the specified save options.
public void Save(Stream stream, SimpleSaveOptions options)
| Parameter | Type | Description | 
|---|---|---|
| stream | Stream | The stream. | 
| options | SimpleSaveOptions | The save options. | 
Examples
Shows how to save project into a stream as an MPP file by using MPP save options.
using (var stream = new FileStream(OutDir + "EmptyProjectSaveStream_out.xml", FileMode.Create, FileAccess.Write))
{
    var project = new Project();
    SimpleSaveOptions options = new MPPSaveOptions();
    // by using of MPPSaveOptions we save it in MPP format
    project.Save(stream, options);
}
Shows how to save project into a stream as an image and to control image options.
var project = new Project();
using (var stream = new FileStream(OutDir + "EmptyProjectSaveStream_out.xml", FileMode.Create, FileAccess.Write))
{
    var options = new ImageSaveOptions(SaveFileFormat.Png);
    // by using of ImageSaveOptions we save the project into image format
    project.Save(stream, options);
}
See Also
- class SimpleSaveOptions
 - class Project
 - namespace Aspose.Tasks
 - assembly Aspose.Tasks
 
Save(Stream, SaveFileFormat)
Saves the project data to the stream.
public void Save(Stream stream, SaveFileFormat format)
| Parameter | Type | Description | 
|---|---|---|
| stream | Stream | The stream. | 
| format | SaveFileFormat | the specified save file format.SaveFileFormat | 
Examples
Shows how to save project into a stream as an XML MS Project file.
var project = new Project();
using (var stream = new FileStream(OutDir + "EmptyProjectSaveStream_out.xml", FileMode.Create, FileAccess.Write))
{
    // Write the stream into XML format
    project.Save(stream, SaveFileFormat.Xml);
}
See Also
- enum SaveFileFormat
 - class Project
 - namespace Aspose.Tasks
 - assembly Aspose.Tasks