Duplicate Method

Applies To

Shape object, ShapeRange collection object, Slide object, SlideRange collection object.

Description

Shape object: Creates a duplicate of the specified Shape object, adds the new range of shapes to the Shapes collection immediately after the shape specified originally, and then returns the new Shape object.

ShapeRange object: Creates a duplicate of the specified ShapeRange object, adds the new range of shapes to the Shapes collection immediately after the range of shapes specified originally, and then returns the new ShapeRange object.

Slide object: Creates a duplicate of the specified Slide object, adds the new slide to the Slides collection immediately after the slide specified originally, and then returns a SlideRange object that represents the duplicate slide.

SlideRange object: Creates a duplicate of the specified SlideRange object, adds the new range of slides to the Slides collection immediately after the slide range specified originally, and then returns a SlideRange object that represents the duplicate slides.

Syntax

expression.Duplicate

expression Required. An expression that returns a Shape, ShapeRange, Slide, or SlideRange object.

See Also

Copy method.

Example

This example creates a duplicate of slide one in the active presentation and then sets the background shading and the title text of the new slide. The new slide will be slide two in the presentation.

Set newSlide = ActivePresentation.Slides(1).Duplicate
With newSlide
    .Background.Fill.PresetGradient msoGradientVertical, 1, msoGradientGold
    .Shapes.Title.TextFrame.TextRange.Text = "Second Quarter Earnings"
End With
This example adds a new, blank slide at the end of the active presentation, adds a diamond shape to the new slide, duplicates the diamond, and then sets properties for the duplicate. The first diamond will have the default fill color for the active color scheme; the second diamond will be offset from the first one and will have the default shadow color.

Set mySlides = ActivePresentation.Slides
Set newSlide = mySlides.Add(mySlides.Count + 1, ppLayoutBlank)
Set firstObj = newSlide.Shapes.AddShape(msoShapeDiamond, 10, 10, _
    250, 350)
With firstObj.Duplicate
    .Left = 150
    .Fill.ForeColor.SchemeColor = ppShadow
End With