AddClone

SlideCollection.AddClone method (1 of 4)

Adds a copy of a specified slide to the end of the collection.

public ISlide AddClone(ISlide sourceSlide)
Parameter Type Description
sourceSlide ISlide Slide to clone.

Return Value

New slide.

Remarks

When cloning a slide between different presentations slide’s master can be cloned too. Internal registry is used to track automatically cloned masters to prevent creation of multiple clones of the same master slide. Manual cloning of master slides will be neither prevented nor registered. If you need more control over cloning process use AddClone or AddClone for cloning slides, AddClone or AddClone for cloning layouts and AddClone for cloning masters.

See Also


SlideCollection.AddClone method (2 of 4)

Adds a copy of a specified slide to the end of the specified section.

public ISlide AddClone(ISlide sourceSlide, ISection section)
Parameter Type Description
sourceSlide ISlide Slide to clone.
section ISection Section for a new slide.

Return Value

New slide.

Exceptions

exception condition
ArgumentNullException
PptxEditException

Examples

[C#]
using (IPresentation presentation = new Presentation())
{
    presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 200, 50, 300, 100);
    presentation.Sections.AddSection("Section 1", presentation.Slides[0]);
    
    ISection section2 = presentation.Sections.AppendEmptySection("Section 2");
    presentation.Slides.AddClone(presentation.Slides[0], section2);
    
    // Now the second section contains a copy of the first slide.
}

See Also


SlideCollection.AddClone method (3 of 4)

Adds a copy of a specified slide to the end of the collection.

public ISlide AddClone(ISlide sourceSlide, ILayoutSlide destLayout)
Parameter Type Description
sourceSlide ISlide Slide to clone.
destLayout ILayoutSlide Layout slide for a new slide.

Return Value

New slide.

See Also


SlideCollection.AddClone method (4 of 4)

Adds a copy of a specified source slide to the end of the collection. Appropriate layout will be selected automatically from the specified master (appropriate layout is the layout with the same Type or Name as of layout of the source slide). If there is no appropriate layout then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).

public ISlide AddClone(ISlide sourceSlide, IMasterSlide destMaster, bool allowCloneMissingLayout)
Parameter Type Description
sourceSlide ISlide Slide to clone.
destMaster IMasterSlide Master slide for a new slide.
allowCloneMissingLayout Boolean If there is no appropriate layout in specified master then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).

Return Value

New slide.

Exceptions

exception condition
PptxEditException Thrown if there is no appropriate layout in specified master and allowCloneMissingLayout is false.

See Also