AddClone

AddClone(ISlide)

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

public ISlide AddClone(ISlide sourceSlide)
ParameterTypeDescription
sourceSlideISlideSlide 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


AddClone(ISlide, ISection)

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

public ISlide AddClone(ISlide sourceSlide, ISection section)
ParameterTypeDescription
sourceSlideISlideSlide to clone.
sectionISectionSection for a new slide.

Return Value

New slide.

Exceptions

exceptioncondition
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


AddClone(ISlide, ILayoutSlide)

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

public ISlide AddClone(ISlide sourceSlide, ILayoutSlide destLayout)
ParameterTypeDescription
sourceSlideISlideSlide to clone.
destLayoutILayoutSlideLayout slide for a new slide.

Return Value

New slide.

See Also


AddClone(ISlide, IMasterSlide, bool)

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)
ParameterTypeDescription
sourceSlideISlideSlide to clone.
destMasterIMasterSlideMaster slide for a new slide.
allowCloneMissingLayoutBooleanIf 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

exceptioncondition
PptxEditExceptionThrown if there is no appropriate layout in specified master and allowCloneMissingLayout is false.

See Also