Retrieve the name of a shape
There are two types of shapes in MS Word- InlineShapes
and Shapes
. It's quite easy to check name of shape object with some VBA code:
- select shape
- press Alt+F11 to open VBA Editor
- in Immediate window execute this code:
? Selection.ShapeRange.Name
- as a result you get name of the shape.
InlineShape
doesn't have name property therefore you can't check it's name until you promote your InlineShape
to Shape
type object.
Microsoft Word 2010
onwards
From Microsoft Word 2010
onwards (2010
, 2013
and 2016
) there is an "Selection Pane" included in Microsoft Word
.
On the selection pane the Microsoft Word InlineShapes
as well as the Shapes
are listed and named.
You can find the Selection Pane
in the menu under
- "Home"-tab
- "Editing"-group
- "Select"-button
- "Selection Pane..."
Microsoft Word
versions before 2010
For older Microsoft Word (2003
, 2007
) versions use the VBA approach (?Selection.ShapeRange.Name
) as Kazimierz Jawor posted as an other answer to this question: https://stackoverflow.com/a/17680650