Table of contents
TOC
折叠目录
展开目录

Shapes.AddShape 方法 (PowerPoint)Shapes.AddShape Method (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

创建一个自选图形。返回一个Shape对象,该对象表示新的自选图形。Creates an AutoShape. Returns a Shape object that represents the new AutoShape.

语法Syntax

表达式AddShape类型左侧顶部宽度高度expression. AddShape( Type, Left, Top, Width, Height )

表达式_一个表示形状对象的变量。_expression A variable that represents a Shapes object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
TypeType必需Required可读MsoAutoShapeType指定要创建的自选形状的类型。Specifies the type of AutoShape to create.
LeftLeft必需Required一个Single自选形状左边缘相对于幻灯片左边缘的位置(以磅为单位)。The position, measured in points, of the left edge of the AutoShape relative to the left edge of the slide.
TopTop必需Required一个Single自选形状上边缘相对于幻灯片上边缘的位置(以磅为单位)。The position, measured in points, of the top edge of the AutoShape relative to the top edge of the slide.
WidthWidth必需Required一个Single自选形状的宽度(以磅为单位)。The width of the AutoShape, measured in points.
HeightHeight必需Required一个Single自选形状的高度(以磅为单位)。The height of the AutoShape, measured in points.

返回值Return Value

ShapeShape

注解Remarks

若要更改已添加自选图形的类型,设置AutoShapeType属性。To change the type of an AutoShape that you've added, set the AutoShapeType property.

示例Example

本示例将一个矩形添加myDocumentThis example adds a rectangle to myDocument.

Set myDocument = ActivePresentation.Slides(1) 
myDocument.Shapes.AddShape Type:=msoShapeRectangle, _ 
    Left:=50, Top:=50, Width:=100, Height:=200

另请参阅See also

概念Concepts

Shapes 对象Shapes Object

© 2018 Microsoft