Save

Save(string, SimpleSaveOptions)

Saves the document to a file using the specified save options.

public void Save(string filename, SimpleSaveOptions options)
ParameterTypeDescription
filenameStringThe file name.
optionsSimpleSaveOptionsThe 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


Save(string, SaveFileFormat)

Saves the project data to the file.

public void Save(string filename, SaveFileFormat format)
ParameterTypeDescription
filenameStringThe file name.
formatSaveFileFormatThe 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


Save(string)

Saves the project data to the file in mpp format.

public void Save(string filename)
ParameterTypeDescription
filenameStringThe file name.

See Also


Save(Stream, SimpleSaveOptions)

Saves the project to a stream using the specified save options.

public void Save(Stream stream, SimpleSaveOptions options)
ParameterTypeDescription
streamStreamThe stream.
optionsSimpleSaveOptionsThe 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


Save(Stream, SaveFileFormat)

Saves the project data to the stream.

public void Save(Stream stream, SaveFileFormat format)
ParameterTypeDescription
streamStreamThe stream.
formatSaveFileFormatthe 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