Need help on Visio Custom Properties

G

Gav

I want to link the inputted text description on a visio shape to appear in
the custom properties box. I can modify and create in Custom properties but
the subject title that you initially type into the shape does not
automatically link into custom properties. Can anyone help?
 
W

wr

Hi Gav,

I can see no way in the shapesheet to arrange this,
so I guess you need to use VBA,
you can use the ShapeExitedTextEdit event
example:
Private Sub Document_ShapeExitedTextEdit(ByVal Shape As IVShape)
Dim charObj As Visio.Characters
Dim frmStr As String
Dim shpObj As Visio.Shape
Dim cellObj As Visio.Cell

Set charObj = Application.ActiveWindow.Page.Shapes.ItemFromID(1).Characters
frmStr = charObj.Text

Set shpObj = Application.ActiveWindow.Page.Shapes.ItemFromID(1)
Set cellObj = shpObj.Cells("Prop.Row_1")
cellObj.Formula = """" & frmStr & """"
End Sub

So upon exiting the shapetextedit window the shapetext is captured in
charObj
and that string is used to change the value of prop.Row_1

René
 
M

Michel LAPLANE

Think of creating your shape with several text box grouped with your shape
and to link these text to the custom property of the group.
Insert a customized formula field in these text looking like
"sheet.5!Prop.P1" where "sheet.5" is the name of the group (You can get it
in right click menu "Format=>Special=>Name") and P1 is the name of the
custom property (You can get it in the define custom property dialog box).
The insert field command is available through "Insert=>Field" menu.
 

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