Displaying the custom property value from one shape to another

P

PPL

Hi,
I have a series of shapes with custom properties assigned to each.
I'm wondering how would I create a custom property within one shape which
takes (and maintains) its value from a custom property in a different shape?

For example I have Shapes numbered 1 through 20 (I.e. ShapeNumber field
created via the Visio Shape Numbering add-on)

Shape 1 has a field that says "see Shape 20"
If I insert a new shape and renumber subsequent shapes then I'd like Shape
10 to refer to the new number?

Maybe I'm approaching this completly wrongly but I'm thinking that I need to
create a custom property that takes it's value from the Shape 20 ShapeNumber
?

Does this make any sense please

Any help would be appreciated

TIA

Philip
 
W

wr

Hi Philip

for your first question,
if you want to revert to a value in another shape you use a formula like:
=Sheet.3!Prop.NumberOfShape
and put that formula in the value cell of the custom property

if you want to achieve the scenario that whenever you add a new shape your
custom property that
says "see shape 20" will now say "see shape 21"
or any number that reflect the correct amount of shapes on the drawing you
can only do that through a macro in the shapeadded event for instance:

Private Sub Document_ShapeAdded(ByVal Shape As IVShape)


Dim vshapes As Visio.Shapes
Dim vshape As Visio.Shape
Dim vpag As Visio.Page
Dim cnt As Integer
Dim strL As String

Set vpag = ActivePage
Set vshapes = vpag.Shapes
cnt = vshapes.Count
strL = "see shape " & cnt
For x = 1 To cnt
Set vshape = vshapes.Item(x)

If vshape.Name = "Sheet.3" Then

vshape.CellsSRC(visSectionProp, 3, visCustPropsValue).FormulaU = """" & strL
& """"
End If
Next
End Sub

if you have another scenario at hand just deviate from the above

Rene
 
P

PPL

Thank you Rene for your help.
It's much appreciated.
I'd assumed (and hoped) that your first solution would be dynamic. Having
entered the formula, for example
=Sheet.3!Prop.NumberOfShape that if values changed then they would
automatically be updated?


Thank you again for your help
It's given me a good starting place for me to play
Kind regards
Philip
 

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