Results 1 to 4 of 4
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Last Shape added (2003 SP2)

    Following from <!post=this post,670,002>this post<!/post>, is there a better way to get the Shape that was just added to the slide from the macro?

    lngActvSlide = Powerpoint.ActiveWindow.View.Slide.SlideID
    With Powerpoint.ActivePresentation.Slides.FindBySlideID (lngActvSlide)
    lngLastShape = .Shapes.Count
    With .Shapes(lngLastShape)
    ... do stuff (more questions to come <img src=/S/grin.gif border=0 alt=grin width=15 height=15>)
    -John ... I float in liquid gardens
    UTC -7ąDS

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Last Shape added (2003 SP2)

    The code

    lngActvSlide = Powerpoint.ActiveWindow.View.Slide.SlideID
    With PowerPoint.ActivePresentation.Slides.FindBySlideID (lngActvSlide)

    is overkill, you can simply use

    With Powerpoint.ActiveWindow.View.Slide

    Perhaps you can tweak the following example to suit your purpose:

    With ActiveWindow.View.Slide
    With .Shapes.PasteSpecial(DataType:=ppPasteHTML)
    With .Shadow
    .ForeColor.RGB = RGB(0, 0, 128)
    .OffsetX = 5
    .OffsetY = -3
    .Transparency = 0.5
    .Visible = True
    End With
    End With
    End With

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Last Shape added (2003 SP2)

    Ka-ching! And, magically, my Shape formatting code is working, so, no further questions Thanks for your help, Hans!
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Last Shape added (2003 SP2)

    Does this not work

    Dim oshp As ShapeRange
    With ActiveWindow.View.Slide
    Set oshp = .Shapes.PasteSpecial(DataType:=ppPasteHTML)
    'oshp.dowhatever
    End With

Posting Permissions

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