I use this code snippet to name my shapes as well as get the name for them.
Code:
Sub Name()
Dim sResponse As String
With ActiveWindow.Selection.ShapeRange(1)
sResponse = InputBox("new name ...", "Rename Shape", .Name)
Select Case sResponse
' blank names not allowed
Case Is = ""
Exit Sub
' no change?
Case Is = .Name
Exit Sub
Case Else
On Error Resume Next
.Name = sResponse
If Err.Number <> 0 Then
MsgBox "Unable to rename this shape"
End If
End Select
End With
End Sub
I run this macro to a button on my toolbar and then just click it when I need the name of a shape. You could probably do something similar if you wanted a less bloated version. Maybe like
Code:
Sub name2()
Dim x As String
On Error Resume Next
x = ActiveWindow.Selection.ShapeRange(1).name
If x <> "" Then MsgBox x
On Error GoTo 0
End Sub
Let me know Thanks