Renaming shapes

C

ciw2otv

Please help with an addin to rename shapes in Word. Granted this is a
Powerpoint newsgroup, but I have two strong reasons for posting here.
1) shapes and names are not widely documented in Word or Word VBA
newsgroups and b) I understand the nuances of Powerpoint better than
Word and iii) some really clever and amusing stuff gets written here.

Shyam's VBA code section for Powerpoint-

Sub Identify(oShp as Shape)
Msgbox oShp.Name
End Sub

has given me a lot of mileage for Powerpoint. When it comes to
PPTslide/Word document differential, the languages seem to loose
something in translation.
Thank you,
Eldon
 
G

Guest

Shyam's code is for show mode, it wouldnt work in edit mode and since word
doesn't have a show mode ....

Try this either in Word or Edit mode with a selected shape

Sub identifyme()
On Error GoTo errhandler
MsgBox ActiveWindow.Selection.ShapeRange.Name
Exit Sub
errhandler:
MsgBox "Error!"
End Sub
 
C

ciw2otv

Shyam's code is for show mode, it wouldnt work in edit mode and since word
doesn't have a show mode ....

Try this either in Word or Edit mode with a selected shape

Sub identifyme()
On Error GoTo errhandler
MsgBox ActiveWindow.Selection.ShapeRange.Name
Exit Sub
errhandler:
MsgBox "Error!"
End Sub
--
Hello John,
That worked wonders! At the expense of being wordy, I have another
request. Do you have a suggestion for alphabetizing shape names in a
document that can be used for populating a listbox on a userform. I
can do all of the VBA for the form, but when I make a table to collect
the shape names for sorting purposes the table seems to move shapes on
the page to make room for itself. Upon deleting the table the shape
are reluctant to return to their original location. The help file
shows how to create another document, but it seems to get lost in
cyberspace somewhere; I can't keep track of it even when I specify the
path and document name.
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top