Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: rodsoares101 on March 03, 2009, 04:04:24 PM

Title: Displaying a shape properties on a text callout automatically
Post by: rodsoares101 on March 03, 2009, 04:04:24 PM
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.
Title: Re: Displaying a shape properties on a text callout automatically
Post by: Paul Herber on March 03, 2009, 11:49:04 PM
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.

Title: Re: Displaying a shape properties on a text callout automatically
Post by: rodsoares101 on March 04, 2009, 12:21:47 PM
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?
Title: Re: Displaying a shape properties on a text callout automatically
Post by: rodsoares101 on April 02, 2009, 03:07:36 PM
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.