Clear

OleObjectCollection.Clear method

Clears the collection. In order to persist these changes project.Save should be called with new MPPSaveOptions { WriteViewData = true; }

public void Clear()

Examples

How to clear OLE objects and persist these changes.

[C#]
project.OleObjects.Clear();
project.Save("output.mpp", new MPPSaveOptions {WriteViewData = true;} )

Shows how to remove OLE objects from the specified project.

[Test]
public void ClearOleObjects()
{
    var project = new Project(DataDir + "TaskImage2010.mpp");
    project.OleObjects.Clear();
    project.Save(OutDir + "ClearedProject.mpp");
}

See Also