Sir,


I am a newbie in PowerPoint vba.It may be super simple question for other but I can not configure it.
I want to merge two shape by subtract using vba.
I find a solution from searching web but how to rename this new generated shape/make a shape object.

I want to rename it "MergeShape"


Any solution will be appreciated.


Sub mergeShape()
Dim shp1 As Shape
Dim shp2 As Shape
Dim shp3 As Shape
Set shp1 = ActivePresentation.Slides(1).Shapes("Rectangle1")
Set shp2 = ActivePresentation.Slides(1).Shapes("Pentagon1")
Call ActiveWindow.Selection.SlideRange(1).Shapes.Range(Array(shp1.ZOrderPosition, shp2.ZOrderPosition)).MergeShapes(msoMergeSubtract, shp1)
End Sub