应用于 CanvasShapes 对象的 AddCallout 方法。
在画布上添加无框线的标注。返回一个代表该标注的 Shape 对象,并将其添加到 CanvasShapes 集合。
expression.AddCallout(Type, Left, Top, Width, Height)
expression 必需。该表达式返回一个 CanvasShapes 对象。
Type MsoCalloutType,必需。标注的类型。
MsoCalloutType 可以是下列 MsoCalloutType 常量之一: |
msoCalloutOne 沿标注边框的左侧边缘垂直向下定位标注线。 |
msoCalloutTwo 沿对角线向下并远离标注边框左侧边缘定位标注线。 |
msoCalloutThree 直接向外,沿对角线向下并远离标注边框左侧边缘定位标注线。 |
msoCalloutFour 沿标注边框左侧边缘定位标注线。 |
msoCalloutMixed 一个返回值,该值表示某区域或选定内容中存在多于一个 MsoCalloutType。 |
Left Single 类型,必需。标注边框左侧边缘的位置,以磅为单位。
Top Single 类型,必需。标注边框上部边缘的位置,以磅为单位。
Width Single 类型,必需。标注边框的宽度,以磅为单位。
Height Single 类型,必需。标注边框的高度,以磅为单位。
在文档中添加无框线的标注。返回代表该标注的 Shape 对象,并将其添加到 Shapes 集合。
expression.AddCallout(Type, Left, Top, Width, Height, Anchor)
expression 必需。该表达式返回一个 Shapes 对象。
Type MsoCalloutType,必需。标注的类型。
MsoCalloutType 可以是下列 MsoCalloutType 常量之一: |
msoCalloutOne 沿标注框左侧边缘垂直向下定位标注线。 |
msoCalloutTwo 沿对角线向下并远离标注框左侧边缘定位标注线。 |
msoCalloutThree 直接向外,沿对角线向下并远离标注框左侧边缘定位标注线。 |
msoCalloutFour 沿标注文本框左侧边缘定位标注线。 |
msoCalloutMixed 一个返回值,该值表示在某区域或选定内容中存在多于一个 MsoCalloutType。 |
Left Single 类型,必需。标注边框左侧边缘的位置,以磅为单位。
Top Single 类型,必需。标注边框上部边缘的位置,以磅为单位。
Width Single 类型,必需。标注边框的宽度,以磅为单位。
Height Single 类型,必需。标注边框的高度,以磅为单位。
Anchor Variant 类型,可选。一个 Range 对象,该对象代表该标注绑定的文本。如果指定 Anchor,则锁定标记将出现在锁定区域第一段的起始位置。如果忽略该参数,将自动选择锁定区域,并根据页面的上边界和左边界的相对位置来定位标注。
使用 AddShape 方法可以插入多种不同的标注,例如气球和云朵。
本示例在新创建的画布上添加标注。
Sub NewCanvasCallout()
Dim shpCanvas As Shape
'Add drawing canvas to the active document
Set shpCanvas = ActiveDocument.Shapes.AddCanvas _
(Left:=150, Top:=150, Width:=200, Height:=300)
'Add callout to the drawing canvas
shpCanvas.CanvasItems.AddCallout _
Type:=msoCalloutTwo, Left:=100, _
Top:=40, Width:=150, Height:=75
End Sub
本示例在当前文档中添加一个标注,然后设置标注的角度。
Sub NewCallout()
Dim shpCallout As Shape
'Add callout to the current document
Set shpCallout = ThisDocument.Shapes.AddCallout( _
Type:=msoCalloutTwo, Left:=InchesToPoints(1.25), _
Top:=36, Width:=100, Height:=25)
'Add text to the callout
shpCallout.TextFrame.TextRange.Text = "This is a Callout."
'Format the angle of the callout line to 30 degrees
shpCallout.Callout.Angle = msoCalloutAngle30
End Sub