Results 1 to 3 of 3

Thread: Copy and Paste Shape on same Position as Source

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    Just to check you are doing this in edit mode. The code would be quite different in show mode.

    Personally I wouldn't copy paste but duplicate. I have included code for both though

    Sub copy_paste()
    Dim osld As Slide
    Dim oshp As Shape
    Dim oshpR As ShapeRange
    ' in case no shape is selected
    On Error Resume Next
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    If Err Then Exit Sub
    oshp.Copy
    Set osld = ActiveWindow.Selection.SlideRange(1)
    Set oshpR = osld.Shapes.Paste
    With oshpR
    .Left = oshp.Left
    .Top = oshp.Top
    End With
    End Sub
    
    
    Sub cloneMe()
    Dim osld As Slide
    Dim oshp As Shape
    On Error Resume Next
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    If Err  Then Exit Sub
    With oshp.Duplicate
    .Left = oshp.Left
    .Top = oshp.Top
    End With
    End Sub
    How to use code
    Last edited by John Wilson; 11-18-2013 at 06:18 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •