PowerPoint VBA教程:AddShape方法

创建一个自选图形。返回一个代表新自选图形的Shape对象。

expression.AddShape(Type, Left, Top, Width, Height)

expression  必选。该表达式返回“应用于”列表中的对象之一。

Type  必选。MsoAutoShapeType 类型。指定要创建的自选图形类型。

MsoAutoShapeType 可以是下列 MsoAutoShapeType 类型常数之一。
msoShapeFlowchartConnector
msoShapeFlowchartData
msoShapeFlowchartDecision
msoShapeFlowchartDelay
msoShapeFlowchartDirectAccessStorage
msoShapeFlowchartDisplay
msoShapeFlowchartDocument
msoShapeFlowchartExtract
msoShapeFlowchartInternalStorage
msoShapeFlowchartMagneticDisk
msoShapeFlowchartManualInput
msoShapeFlowchartManualOperation
msoShapeFlowchartMerge
msoShapeFlowchartMultidocument
msoShapeFlowchartOffpageConnector
msoShapeFlowchartOr
msoShapeFlowchartPredefinedProcess
msoShapeFlowchartPreparation
msoShapeFlowchartProcess
msoShapeFlowchartPunchedTape
msoShapeFlowchartSequentialAccessStorage
msoShapeFlowchartSort
msoShapeFlowchartStoredData
msoShapeFlowchartSummingJunction
msoShapeFlowchartTerminator
msoShapeFoldedCorner
msoShapeHeart
msoShapeHexagon
msoShapeHorizontalScroll
msoShapeIsoscelesTriangle
msoShapeLeftArrow
msoShapeLeftArrowCallout
msoShapeLeftBrace
msoShapeLeftBracket
msoShapeLeftRightArrow
msoShapeLeftRightArrowCallout
msoShapeLeftRightUpArrow
msoShapeLeftUpArrow
msoShapeLightningBolt
msoShapeLineCallout1
msoShapeLineCallout1AccentBar
msoShapeLineCallout1BorderandAccentBar
msoShapeLineCallout1NoBorder
msoShapeLineCallout2
msoShapeLineCallout2AccentBar
msoShapeLineCallout2BorderandAccentBar
msoShapeLineCallout2NoBorder
msoShapeLineCallout3
msoShapeLineCallout3AccentBar
msoShapeLineCallout3BorderandAccentBar
msoShapeLineCallout3NoBorder
msoShapeLineCallout4
msoShapeLineCallout4AccentBar
msoShapeLineCallout4BorderandAccentBar
msoShapeLineCallout4NoBorder
msoShapeMixed
msoShapeMoon
msoShapeNoSymbol
msoShapeNotchedRightArrow
msoShapeNotPrimitive
msoShapeOctagon
msoShapeOval
msoShapeOvalCallout
msoShapeParallelogram
msoShapePentagon
msoShapePlaque
msoShapeQuadArrow
msoShapeQuadArrowCallout
msoShapeRectangle
msoShapeRectangularCallout
msoShapeRegularPentagon
msoShapeRightArrow
msoShapeRightArrowCallout
msoShapeRightBrace
msoShapeRightBracket
msoShapeRightTriangle
msoShapeRoundedRectangle
msoShapeRoundedRectangularCallout
msoShapeSmileyFace
msoShapeStripedRightArrow
msoShapeSun
msoShapeTrapezoid
msoShapeUpArrow
msoShapeUpArrowCallout
msoShapeUpDownArrow
msoShapeUpDownArrowCallout
msoShapeUpRibbon
msoShapeUTurnArrow
msoShapeVerticalScroll
msoShapeWave
msoShapeFlowchartCollate
msoShape16pointStar
msoShape24pointStar
msoShape32pointStar
msoShape4pointStar
msoShape5pointStar
msoShape8pointStar
msoShapeActionButtonBackorPrevious
msoShapeActionButtonBeginning
msoShapeActionButtonCustom
msoShapeActionButtonDocument
msoShapeActionButtonEnd
msoShapeActionButtonForwardorNext
msoShapeActionButtonHelp
msoShapeActionButtonHome
msoShapeActionButtonInformation
msoShapeActionButtonMovie
msoShapeActionButtonReturn
msoShapeActionButtonSound
msoShapeArc
msoShapeBalloon
msoShapeBentArrow
msoShapeBentUpArrow
msoShapeBevel
msoShapeBlockArc
msoShapeCan
msoShapeChevron
msoShapeCircularArrow
msoShapeCloudCallout
msoShapeCross
msoShapeCube
msoShapeCurvedDownArrow
msoShapeCurvedDownRibbon
msoShapeCurvedLeftArrow
msoShapeCurvedRightArrow
msoShapeCurvedUpArrow
msoShapeCurvedUpRibbon
msoShapeDiamond
msoShapeDonut
msoShapeDoubleBrace
msoShapeDoubleBracket
msoShapeDoubleWave
msoShapeDownArrow
msoShapeDownArrowCallout
msoShapeDownRibbon
msoShapeExplosion1
msoShapeExplosion2
msoShapeFlowchartAlternateProcess
msoShapeFlowchartCard

Left  必选。Single 类型。自选图形左边缘相对于幻灯片左边缘的位置(以磅为单位)。

Top  必选。Single 类型。自选图形上边缘相对于幻灯片上边缘的位置(以磅为单位)。

Width  必选。Single 类型。自选图形的宽度(以磅为单位)。

Height  必选。Single 类型。自选图形的高度(以磅为单位)。

说明

若要更改添加的自选图形的类型,请设置AutoShapeType属性。

VBA示例

本示例在myDocument中添加一个矩形。


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

上页:PowerPoint VBA教程:AddPolyline方法 下页:PowerPoint VBA教程:AddTable方法

PowerPoint VBA教程:AddShape方法

PowerPoint VBA教程:AddTable方法 PowerPoint VBA教程:AddTextbox方法
PowerPoint VBA教程:AddTextEffect方法 PowerPoint VBA教程:AddTitle方法
PowerPoint VBA教程:AddTitleMaster方法 PowerPoint VBA教程:AddToFavorites方法
PowerPoint VBA教程:Align方法 PowerPoint VBA教程:Apply方法
PowerPoint VBA教程:ApplyTemplate方法 PowerPoint VBA教程:Arrange方法
PowerPoint VBA教程:AutomaticLength方法 PowerPoint VBA教程:Background方法
PowerPoint VBA教程:BeginConnect方法 PowerPoint VBA教程:BeginDisconnect方法
PowerPoint VBA教程:BuildFreeform方法 PowerPoint VBA教程:CanCheckIn方法
PowerPoint VBA教程:CanCheckOut方法 PowerPoint VBA教程:Cell方法
PowerPoint VBA教程:ChangeCase方法 PowerPoint VBA教程:Characters方法
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号