PowerPoint VBA教程:ChildShapeRange属性

返回ShapeRange对象,该对象代表选定形状的子形状的。

expression.ChildShapeRange

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

VBA示例

本示例用绘图画布创建新文档,再向绘图画布中添加形状,并选择添加到画布上的形状。然后,在确认选定的形状为子形状后使用图案填充该子形状。


Sub ChildShapes()
    Dim sldNew As Slide
    Dim shpCanvas As Shape
    'Create a new slide with a drawing canvas and shapes
    Set sldNew = Presentations(1).Slides _
        .Add(Index:=1, Layout:=ppLayoutBlank)
    Set shpCanvas = sldNew.Shapes.AddCanvas( _
        Left:=100, Top:=100, Width:=200, Height:=200)
    With shpCanvas.CanvasItems
        .AddShape msoShapeRectangle, Left:=0, Top:=0, _
            Width:=100, Height:=100
        .AddShape msoShapeOval, Left:=0, Top:=50, _
            Width:=100, Height:=100
        .AddShape msoShapeDiamond, Left:=0, Top:=100, _
            Width:=100, Height:=100
    End With
    'Select all shapes in the canvas
    shpCanvas.CanvasItems.SelectAll
    'Fill canvas child shapes with a pattern
    With ActiveWindow.Selection
        If .HasChildShapeRange = True Then
            .ChildShapeRange.Fill.Patterned Pattern:=msoPatternDivot
        Else
            MsgBox "This is not a range of child shapes."
        End If
    End With
End Sub

上页:PowerPoint VBA教程:Children属性 下页:PowerPoint VBA教程:Collate属性

PowerPoint VBA教程:ChildShapeRange属性

PowerPoint VBA教程:Collate属性 PowerPoint VBA教程:Color属性
PowerPoint VBA教程:Color1 Property PowerPoint VBA教程:Color2属性
PowerPoint VBA教程:ColorEffect属性 PowerPoint VBA教程:ColorScheme属性
PowerPoint VBA教程:ColorSchemes属性 PowerPoint VBA教程:ColorType属性
PowerPoint VBA教程:Columns属性 PowerPoint VBA教程:COMAddIns属性
PowerPoint VBA教程:CommandBars属性 PowerPoint VBA教程:Comments属性
PowerPoint VBA教程:ConnectionSiteCount属性 PowerPoint VBA教程:Connector属性
PowerPoint VBA教程:ConnectorFormat属性 PowerPoint VBA教程:Container属性
PowerPoint VBA教程:Contrast属性 PowerPoint VBA教程:Count属性
PowerPoint VBA教程:Creator属性 PowerPoint VBA教程:CropBottom属性
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号