Shapes 对象

包含非嵌入式的图形、形状、图片、OLE 对象、ActiveX 控件、文本对象和标注。

属性/方法 意义
Count 包含对象个数
Item(n) 返回 Shape 对象
Range(name/index) 同上类似
AddCallout() 创建无线框标注
AddCurve(SafeArrayOfPoints, Anchor) 创建一条贝塞尔曲线
AddLabel(Orientation, Left, Top, Width, Height, Anchor) 创建一个标签
AddLine(BeginX, BeginY, EndX, EndY, Anchor) 创建一条直线
AddOLEControl(ClassType, Left, Top, Width, Height, Anchor) 创建 ActiveX 对象
AddOLEObject(ClassType, FileName, LinkToFile, DisplayAsIcon, IconFileName, IconIndex, IconLabel, Left, Top, Width, Height, Anchor) 创建 OLE 对象
AddPicture(FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Anchor) 插入图片
AddPolyline(SafeArrayOfPoints, Anchor) 创建多直线
AddShape(Type, Left, Top, Width, Height, Anchor) 插入自选图形
AddTextbox(Orientation, Left, Top, Width, Height, Anchor) 插入文本框
AddTextEffect(PresetTextEffect, Text, FontName, FontSize, FontBold, FontItalic, Left, Top, Anchor) 插入艺术字
BuildFreeform(EditingType, X1, Y1) 创建一个任意多边形
SelectAll() 全部选定
参数 意义
Anchor Range 对象,锚点位置
SafeArrayOfPoints 表示一组坐标位置的二维数组,从 0 起,第二维为 1
Left Top 左 上角位置,磅值
Right Bottom 右 下角位置,磅值

文本框方向

常量 意义
msoTextOrientationDownward 右上 左下,方向向右倒
msoTextOrientationHorizontal 正常
msoTextOrientationHorizontalRotatedFarEast 正常流向,文字向左倒
msoTextOrientationMixed  
msoTextOrientationUpward 左下 右上,文字向左倒
msoTextOrientationVertical  
msoTextOrientationVerticalFarEast 右上 左下