Consulting

Results 1 to 3 of 3

Thread: Pick shape and Copy shape to all the slides

  1. #1

    Pick shape and Copy shape to all the slides

    Hello All,

    I am trying to create a vba code to pick the shape and copy to all the slides in ppt 2007. Below is the code. It copies the shape in the same slide.

    Thanks for your help.

    Option Base 1
    Dim selshp As Shape
    Dim itop As Integer, ileft As Integer
    Dim sld As Slide
    Dim sldind As Integer
    Public Sub pickshp()
    sldind = ActiveWindow.View.Slide.SlideIndex
    Set selshp = ActiveWindow.Selection.ShapeRange(1)
    itop = selshp.Top
    ileft = selshp.Left
    End Sub
    Public Sub copyshapetoallslides()
    For Each sld In ActivePresentation.Slides
    selshp(1).Duplicate
    selshp.Top = itop
    selshp.Left = ileft
    Next sld
    End Sub

    Thanks and Regards,
    Balu.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Select the shape and run:
    [VBA]Sub Copy_Paste()
    Dim oshp As Shape
    Dim i As Integer
    Dim osldcurrent As Slide
    If ActiveWindow.Selection.Type = ppSelectionNone Then Exit Sub
    If ActiveWindow.Selection.ShapeRange.Count <> 1 Then Exit Sub
    Set osldcurrent = ActiveWindow.Selection.SlideRange(1)
    ActiveWindow.Selection.ShapeRange(1).Copy
    For i = 1 To ActivePresentation.Slides.Count
    If i <> osldcurrent.SlideIndex Then ActivePresentation.Slides(i).Shapes.Paste
    Next i
    End Sub[/VBA]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3

    Thanks John - One more query in the same

    Thanks John, It's working. I have one more query. Is it possible to pick the shape? and copy it in only the necessary slides?

    Thanks again for this help.

    Regards,
    Balu.

Posting Permissions

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