Shapes.AddCallout Method (Excel)
Creates a borderless line callout. Returns a Shape object that represents the new callout.
Syntax
expression .AddCallout(Type, Left, Top, Width, Height)
expression A variable that represents a Shapes object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Type |
Required |
The type of callout line. |
|
Left |
Required |
Single |
The position (in points) of the upper-left corner of the callout's bounding box relative to the upper-left corner of the document. |
Top |
Required |
Single |
The position (in points) of the upper-left corner of the callout's bounding box relative to the upper-left corner of the document. |
Width |
Required |
Single |
The width of the callout's bounding box, in points. |
Height |
Required |
Single |
The height of the callout's bounding box, in points. |
Return Value
Shape
Remarks
MsoCalloutType can be one of these MsoCalloutType constants. |
msoCalloutOne. A single-segment callout line that can be either horizontal or vertical. |
msoCalloutTwo. A single-segment callout line that rotates freely. |
msoCalloutMixed. |
msoCalloutThree. A two-segment line. |
msoCalloutFour. A three-segment line. |
You can insert a greater variety of callouts by using the AddShape method.
Example
This example adds a borderless callout with a freely rotating one-segment callout line to myDocument and then sets the callout angle to 30 degrees.
Set myDocument = Worksheets(1)
myDocument.Shapes.AddCallout(Type:=msoCalloutTwo, _
Left:=50, Top:=50, Width:=200, Height:=100) _
.Callout.Angle = msoCalloutAngle30