Adding Callouts to shapes
There is a built-in stencil called Callouts in the Visio Extras category, but the Callouts introduced as part of Structured Diagram API are something different. These are a special type of Shape that have some programmatic control. Any shape can have many Callouts associated with it. The names of Callout Masters in the built-in stencil can be read by moving the mouse over them in the Insert | Diagram Parts | Callout drop-down gallery, as in the following screenshot:
![](https://static.packt-cdn.com/products/9781785882661/graphics/B05241_09_29.jpg)
The following code, AddCallouts()
, gets a reference to the Thought
Bubble callout from the built-in stencil. It then loops through all the shapes in the active page that are linked to Personnel
DataRecordset
. It drops a new shape instance of the Callout Master and associates it with the Person shape, and inserts the name of Person Shape as text.
![](https://static.packt-cdn.com/products/9781785882661/graphics/B05241_09_30.jpg)
The resultant diagram is shown in the following screenshot:
![](https://static.packt-cdn.com/products/9781785882661/graphics/B05241_09_31.jpg)
Callouts can be used for comments or notes, or even as additional placeholders for information held...