MergeShapes returns VOID so iot is difficult to refer to the new shape. However in most cases it will have the zorder position one less than the first shape so this MIGHT work

Sub mergeShape()
Dim shp1 As Shape
Dim shp2 As Shape
Dim shp3 As Shape
Dim osld As Slide
Dim lngPos As Long
Set osld = ActivePresentation.Slides(1)
Set shp1 = osld.Shapes("Rectangle1")
lngPos = shp1.ZOrderPosition
Set shp2 = osld.Shapes("Pentagon1")
Call osld.Shapes.Range(Array(shp1.ZOrderPosition, shp2.ZOrderPosition)).MergeShapes(msoMergeSubtract, shp1)
osld.Shapes(lngPos - 1).Name = "merged"
End Sub