I am looking for a way to kind of re-engineer the VBA code I need to create a certain visual in PowerPoint.
For example purposes let’s say, I want to create code to create this:
Right now I have wrote the following VBA code that allows you highlight the shapes used in the powerpoint:
Sub ListAllShapes() Dim curSlide As Slide Dim curShape As Shape For Each curSlide In ActivePresentation.Slides Debug.Print curSlide.SlideNumber For Each curShape In curSlide.Shapes MsgBox curShape.Name Next curShape Next curSlide End Sub
If I run this with my example I get the following output:
However when I then lookup the Shape.name here: https://docs.microsoft.com/en-us/office/vba/api/office.msoautoshapetype I see that Autoshpape 7 is msoShapeIsoscelesTriangle. If I then insert the following code:
Sub InsertShape() Set myDocument = ActivePresentation.Slides(1) myDocument.Shapes.AddShape Type:=msoShapeIsoscelesTriangle, _ Left:=50, Top:=50, Width:=100, Height:=200 End Sub
I get a different graph, any thoughts on where I am going wrong?