Excel VBA教程:AutoShapeType属性

返回或设置指定的 Shape对象或 ShapeRange对象的形状类型,该对象必须代表自选图形,而不能是直线、任意多边形或连接符。MsoAutoShapeType 类型,可读写。

注意   更改形状的类型时,形状将保留其大小、颜色和其他属性。

MsoAutoShapeType 可为以下 MsoAutoShapeType 常量之一。
msoShape24pointStar
msoShape4pointStar
msoShape8pointStar
msoShapeActionButtonBeginning
msoShapeActionButtonDocument
msoShapeActionButtonForwardorNext
msoShapeActionButtonHome
msoShapeActionButtonMovie
msoShapeActionButtonSound
msoShapeBalloon
msoShapeBentUpArrow
msoShapeBlockArc
msoShapeChevron
msoShapeCloudCallout
msoShapeCube
msoShapeCurvedDownRibbon
msoShapeCurvedRightArrow
msoShapeCurvedUpRibbon
msoShapeDonut
msoShapeDoubleBracket
msoShapeDownArrow
msoShapeDownRibbon
msoShapeExplosion2
msoShapeFlowchartCard
msoShapeFlowchartConnector
msoShapeFlowchartDecision
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
msoShapeQuadArrowCallout
msoShapeRectangularCallout
msoShapeRightArrow
msoShapeRightBrace
msoShapeRightTriangle
msoShapeRoundedRectangularCallout
msoShapeStripedRightArrow
msoShapeTrapezoid
msoShapeUpArrowCallout
msoShapeUpDownArrowCallout
msoShapeUTurnArrow
msoShapeWave
msoShape16pointStar
msoShape32pointStar
msoShape5pointStar
msoShapeActionButtonBackorPrevious
msoShapeActionButtonCustom
msoShapeActionButtonEnd
msoShapeActionButtonHelp
msoShapeActionButtonInformation
msoShapeActionButtonReturn
msoShapeArc
msoShapeBentArrow
msoShapeBevel
msoShapeCan
msoShapeCircularArrow
msoShapeCross
msoShapeCurvedDownArrow
msoShapeCurvedLeftArrow
msoShapeCurvedUpArrow
msoShapeDiamond
msoShapeDoubleBrace
msoShapeDoubleWave
msoShapeDownArrowCallout
msoShapeExplosion1
msoShapeFlowchartAlternateProcess
msoShapeFlowchartCollate
msoShapeFlowchartData
msoShapeFlowchartDelay
msoShapeQuadArrow
msoShapeRectangle
msoShapeRegularPentagon
msoShapeRightArrowCallout
msoShapeRightBracket
msoShapeRoundedRectangle
msoShapeSmileyFace
msoShapeSun
msoShapeUpArrow
msoShapeUpDownArrow
msoShapeUpRibbon
msoShapeVerticalScroll

expression.AutoShapeType

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

说明

可用ConnectorFormat对象的 Type属性设置或返回连接符的类型。

Excel VBA教程:AutoShapeType属性·示例

本示例将myDocument 中所有的 16 磅星形替换为 32 磅星形。


Set myDocument = Worksheets(1)
For Each s In myDocument.Shapes
    If s.AutoShapeType = msoShape16pointStar Then
        s.AutoShapeType = msoShape32pointStar
    End If
Next

上页:Excel VBA教程:AutoScaling属性 下页:Excel VBA教程:AutoShowCount属性

Excel VBA教程:AutoShapeType属性

Excel VBA教程:AutoShowCount属性 Excel VBA教程:AutoShowField属性
Excel VBA教程:AutoShowRange属性 Excel VBA教程:AutoShowType属性
Excel VBA教程:AutoSize属性 Excel VBA教程:AutoSortField属性
Excel VBA教程:AutoSortOrder属性 Excel VBA教程:AutoText属性
Excel VBA教程:AutoUpdate属性 Excel VBA教程:AutoUpdateFrequency属性
Excel VBA教程:AutoUpdateSaveChanges属性 Excel VBA教程:AxisBetweenCategories属性
Excel VBA教程:AxisGroup属性 Excel VBA教程:AxisTitle属性
Excel VBA教程:BackColor属性 Excel VBA教程:Background属性
Excel VBA教程:BackgroundChecking属性 Excel VBA教程:BackgroundQuery属性
Excel VBA教程:Backward属性 Excel VBA教程:Bar3DGroup属性
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号