Referencing Shape with name (unique)?

G

Gary

I have stencils with names. For example I have a stencil object called C1.1

It has a shape called C1Text.0 and a shape called C1Text.1. C1Text0 is just
above the letter C and C1Text.1 is just below.

How can I change the text within C1Text.0 and C1Text.1 using VBA code and
not using the ItemFromID number because that changes each time??????

My unique name doesn't change and there is never a duplicate for my
application.

Thank You,

G
 
J

JuneTheSecond

Hi,

I thought the relation is group.
If so, shape.shapes property gets the child shapes.
My test code is following.

Dim shp As Visio.Shape, child As Visio.Shape
Set shp = ActivePage.Shapes("DAD")
Set child = shp.Shapes("BOY")
child.Text = "My Boy"
ActiveWindow.Select shp.Shapes("BOY"), visSubSelect
ActiveWindow.Selection.BringToFront
 

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