MPPSaveOptions

MPPSaveOptions class

Allows to specify additional options when saving project data to MPP.

public class MPPSaveOptions : SimpleSaveOptions

Constructors

NameDescription
MPPSaveOptions()Initializes a new instance of the MPPSaveOptions class.

Properties

NameDescription
ProtectionPassword { get; set; }Gets or sets a password which is used to protect a resulting MPP file. Currently is supported for MS Project 2010 and newer formats. Null value indicates that the project file is not protected.
RemoveInvalidAssignments { get; set; }Gets or sets a value indicating whether to remove invalid resource assignments when saving to MPP. MS Project creates an empty resource assignment for each task. Set this flag to true to remove them on save.
SaveFormat { get; }Gets or sets the format in which the document will be saved if this save options object is used.
TasksComparer { get; set; }Gets or sets the comparer to sort tasks on Gantt chart and Task Sheet chart.
TasksFilter { get; set; }Gets or sets the condition which is used to filter tasks rendered on Gantt, Task Sheet and Task Usage charts.
WriteFilters { get; set; }Gets or sets a value indicating whether to write filter data when saving to MPP. Filter data includes Project.TaskFilters and Project.ResourceFilters collections.
WriteViewData { get; set; }Gets or sets a value indicating whether to write view data when saving to MPP. View data includes Project.Views, Filters and Tables collections.

Examples

Shows how to save project into a stream as an MPP file.

using (var stream = new FileStream(OutDir + "EmptyProjectSaveStream_out.xml", FileMode.Create, FileAccess.Write))
{
    var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

    // create save options
    SimpleSaveOptions options = new MPPSaveOptions
    {
        // sets a value indicating whether to remove invalid resource assignments when saving to MPP
        RemoveInvalidAssignments = true
    };

    // save MPP with options
    project.Save(stream, options);
}

See Also