Link to home
Start Free TrialLog in
Avatar of Bryce Bassett
Bryce BassettFlag for United States of America

asked on

Programmatically change PowerPoint picture placeholder from rectangle to oval?

I'm building a PowerPoint (2010) template to conform to our new company design.  It includes a lot of round picture placeholders.   Manually, it's easy to create a new slide layout, insert a picture placeholder (which comes in by default as a rectangle), then use change shape to change it to an oval.   I just need to accomplish that with VBA.  The following code creates a new layout and adds the picture placeholder.  

layoutcount = ActivePresentation.Designs(1).SlideMaster.CustomLayouts.Count

Set newlayout = ActivePresentation.Designs(1).SlideMaster.CustomLayouts _
    .Add(layoutcount + 1)

Set ph = newlayout.Shapes.AddPlaceholder(ppPlaceholderPicture, _
    Left:=100, Top:=200, Width:=100, Height:=100)

Open in new window


Now how would I change "ph" to an oval?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bryce Bassett

ASKER

Perfectly simple!

Thanks.

Yes, I always declare my variables and use Option Explicit.  I just was posting a snippet of my code.  But good reminder
You'd be amazed how many folk don't think declaring variables correctly is important! (Well maybe not)