Word VBA教程:AutoShapeType属性

返回或设置指定的ShapeShapeRange对象的图形类型,该对象不是代表线条或任意多边形,而是代表自选图形。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   必需。该表达式返回“应用于”列表中的一个对象。

说明

改变图形类型时,图形保留原来的大小、颜色和其他属性。

VBA示例

本示例将活动文档中的所有 16 磅星形替换为 32 磅星形。


Sub ReplaceAutoShape()
    Dim docNew As Document
    Dim shpStar As Shape
    Set docNew = ActiveDocument
    For Each shpStar In docNew.Shapes
        If shpStar.AutoShapeType = msoShape16pointStar Then
            shpStar.AutoShapeType = msoShape32pointStar
        End If
    Next
End Sub

Word VBA教程

Word VBA参考教程:目录1 Word VBA参考教程:目录2
Word VBA参考教程:目录3 Word VBA参考教程:目录4
Word VBA参考教程:目录5 Word VBA参考教程:目录6
Word VBA参考教程:目录7 Word VBA参考教程:目录8
Word VBA参考教程:目录9 Word VBA参考教程:目录10
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号