Hi
Does anybody know how to return the name or index number from a selected
shape in Word.
I thought it should be something like this:

msgbox Activedocument.Shapes(ActiveShape).name

but it is not working

/Finn

Re: How to return the name from selected shape by Helmut

Helmut
Sat Oct 16 17:23:04 CDT 2004

Hi Finn,
easy with the name, kind of odd with the index:
Sub test9991()
Dim n As String 'Name
Dim i As Integer
n = Selection.ShapeRange.Name
For i = 1 To ActiveDocument.Shapes.Count
If ActiveDocument.Shapes(i).Name = n Then
MsgBox "Shape " & Chr(34) & n & Chr(34) & " is Shape " & i
Exit For
End If
Next
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/

Re: How to return the name from selected shape by Finn

Finn
Sun Oct 17 06:35:16 CDT 2004

"Helmut Weber" <elmkqznfwvccbf@mailinator.com> skrev i en meddelelse
news:cn73n01ers0m4vordto8agslfk8642vne1@4ax.com...
> Hi Finn,
> easy with the name, kind of odd with the index:
> Sub test9991()
> Dim n As String 'Name
> Dim i As Integer
> n = Selection.ShapeRange.Name
> For i = 1 To ActiveDocument.Shapes.Count
> If ActiveDocument.Shapes(i).Name = n Then
> MsgBox "Shape " & Chr(34) & n & Chr(34) & " is Shape " & i
> Exit For
> End If
> Next
> End Sub
> ---
> Greetings from Bavaria, Germany
> Helmut Weber, MVP
> "red.sys" & chr(64) & "t-online.de"
> Word XP, Win 98
> http://word.mvps.org/

Thanks Helmut
It works perfect
/Finn