Accessing custom properties in Visio 2002 problem

S

sbenoist

Hi,

I had a nice little tool to decorate shapes based on custom properties,
storing the data in excel, etc etc. It was working fine with Visio 5,
but after upgrading
to Visio 2002, everything is broken

Here is a code snippet of what I had to export some shapes to Excel.

For i = 1 To myPage.Shapes.Count

Set sh = myPage.Shapes(i)

With myPage.Shapes(i)
If .CellExists("Prop.SystemID", 0) Then
sysRowChar = LTrim(Str(sysRow))

For Each prop In sysProps
Call ExportProperty(prop, sysRowChar,
myPage.Shapes(i), ss)
Next prop
sysRow = sysRow + 1
End If

If .CellExists("Prop.From", 0) Then

linksRowChar = LTrim(Str(linksRow))
For Each prop In linksProps
Call ExportProperty(prop, linksRowChar,
myPage.Shapes(i), ls)
Next prop

linksRow = linksRow + 1
End If

End With
Next

The problem is that in Visio 5, the test for .CellExists was working.
Now, it is
totally impossible to access any of the custom properties added from
Visio 2002 into a shape. My old diagrams (Visio 5) still work fine, but
I cannot add / modify / remove any custom property. I suspected a
version problem between Visio 5 and visio 2002 shapes, so I started
from scratch in Visio 2002 with clean shapes, defined a custom property
set, applied it to some shapes, and... nothing. The good old way to
access custom properties with .Cells("Prop.myCustomProperty") seems to
be broken. Custom properties do not appear anywhere in the debugger so
I am completely lost

Any ideas ?

-s
 
J

JuneTheSecond

Would you test nexy code in both version of Visio?
If there is no problem, the problem would be in any place in your code other
than CellExists method.

Sub test()
Dim I As Long
Dim myPage As Visio.Page
Dim sh As Visio.Shape

Set myPage = ActivePage
For I = 1 To myPage.Shapes.Count

Set sh = myPage.Shapes(I)

With myPage.Shapes(I)
If .CellExists("Prop.SystemID", 0) Then
MsgBox "Prop.SystemID exists."
End If

If .CellExists("Prop.From", 0) Then
MsgBox "Prop.From exists."
End If

End With
Next
End Sub
 
S

sbenoist

Tested in a brand new Visio 2002 diagram, with Visio 2002 shapes and
custom property sets applied. the test() method that you suggested
above does not see *anything* even though I have only 3 shapes in my
test diagram and I *can* see the properties in the custom properties
window when clicking on the shapes. I am really, really lost.
 

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