Sub AssignName()
Dim name As String
With ActiveWindow.Selection.ShapeRange(1)
name = InputBox("New name:", "Rename Object", .Name)
Select Case name
Case Is = ""
Exit Sub
Case Else
On Error Resume Next
.Name = name
If Err.Number <> 0 Then
MsgBox "Cannot rename object"
End If
End Select
End With
End Sub
An easy way to name objects in a PowerPoint file, which is pretty much a necessity of you want to be able to use automation to manipulate the objects in a preentation, is to use a dedicated function in you presentation to do so.