I'm trying to have all shapes show in listbox and when I click on the shape in listbox the value show is a text box which I can update and commit the changes. So I've read a little on Query but I'm not sure this is the best method or most efficient way.
Public Sub GetShapes()
Dim s As Shape, sr As ShapeRange, p As Page
For Each sr In ActivePage.Shapes.FindShapes(Query:="@type='text:artistic' or @type = 'text:paragraph'")
frmMain.listShape.AddItem
Next sr
End Sub
Assuming you want the ListBox to have the Text that is the shape you can do this:
Dim s As Shape For Each s In ActivePage.Shapes.FindShapes(Query:="@type='text:artistic' or @type = 'text:paragraph'") lstText.AddItem s.Text.Story Next s
I would recommend also capturing the StaticID in your loop in case you have two shapes with the same text.
-Shelby
Thanks Shelby
Once I've captured the staticID would I store it in a variable. I've figured out how to have the static ID show in the ListBox. I know that once I select the item in the listbox I want that shape to be selected but from there I'm stuck.