Displaying a shape properties on a text callout automatically

Started by rodsoares101, March 03, 2009, 04:04:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rodsoares101

I'm trying to build a stencil for process mapping and couldn't find anything on how to display a shape properties information automatically. I created my on text callout and works fine but how do I display it without doing the regular rotine - show shape data > new data graphic... and so on. Is there any code I could add to the form to make it display the text callout by double clicking or something? (e.g. I have an activity that requires a specific set of document and I specify these documents on the activity property, so when I double click on the activity the text callout or something similar pops up displaying the information I need). And Also is there a code to make the shape properties pop up when a new shape is added to the page for configuration?

Thanks.
Rodrigo.

Paul Herber

If the data is stored in the shape's custom properties (shape data in V2008) or user-defined data then you can display this data as a data field within the shape's text.
Select the shape, then menu Insert -> Field
and find the data in the appropriate section. You can also do multiple fields interspersed with ordinary text.
That does the job once for one shape, create a new stencil and drag your new shape into the stencil and save it.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

rodsoares101

Thanks Paul!
I appreciate your quick reply, but how do I change between fields automacally? E.g. The shape is displaying the information of one custon property and then when I double click it changes to another line of custon property or the shape text?

rodsoares101

Answering my own question, so anyone with the same issue can learn too.
1) you need create a datagraphic.
2) make 2 macros one to apply the datagraphic and another to remove
Sub apply_datagraphic()
Visio.ActiveWindow.Selection.DataGraphic = Visio.ActiveDocument.Masters("datagraphicname")
End Sub
Sub remove_datagraphic()
Visio.ActiveWindow.Selection.DataGraphic = Nothing
End Sub

From there you need to decide how to run the macro, by double clicking the shapo, context menu.
I made an example with a right click menu.