HowTo read custom properties using VBA

G

Gief

I define a custom property (e.g. name is "Action")
manually in a Visio (2002) drawing and then try to read
the content using a vb code, but I get only the error :
Unexpected end of file.
Code sample:
Sub GetItem()
With ActivePage

Set obj = .Shapes("Sheet.6").Cells("User.Test1")

End With
End Sub
What's wrong?

Thx.
Heinrich
 
A

al

I use something like this...

strValue = visShape.Cells("prop.cellname.value").ResultStr
("")

al
 
M

Michael J. Hunter [MS]

Al,

If you don't have the cell name exactly correct, Visio won't be able to
locate the cell and will throw the "Unexpected end of file" error you are
encountering. There is logic to the way cells are named, but until you've
memorized that logic the simplest way to determine the cell's name is to
open the shape's ShapeSheet, type an equals sign (=) in some other cell,
then click the cell whose name you want to know. Visio will display the
name of the cell you clicked after the equals sign in the other cell.


Michael J. Hunter
Microsoft
michhu-at-online-dot-microsoft-dot-com

Developing Microsoft Visio Solutions:
http://msdn.microsoft.com/library/en-us/devref/HTML/DVS_Copyright_1270.asp
Developer Resources for Microsoft Visio:
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000456

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
G

Gief

Hello Michael

thanks - this works.
I found out that my customer property has the name Row_4.

Heinrich
 

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