WPS 基础接口 > 演示 API 参考 > Selection > 属性 > Selection.ChildShapeRange 属性
返回一个代表选定范围的子形状的 ShapeRange 对象。

语法

表达式.ChildShapeRange

表达式   一个代表 Selection 对象的变量。

返回值
ShapeRange

示例

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

示例代码
function ChildShapes(){
    //Create a new slide with a drawing canvas and shapes
    let sldNew = Presentations.Item(1).Slides.Add(1, ppLayoutBlank)
    let shpCanvas = sldNew.Shapes.AddCanvas(100, 100, 200, 200)

    let canvasitems = shpCanvas.CanvasItems
        canvasitems.AddShape(msoShapeRectangle, 0, 0, 100, 100)
        canvasitems.AddShape(msoShapeOval, 0, 50, 100, 100)
        canvasitems.AddShape(msoShapeDiamond, 0, 100, 100, 100)

    //Select all shapes in the canvas
    shpCanvas.CanvasItems.SelectAll()

    //Fill canvas child shapes with a pattern
    let selection = ActiveWindow.Selection
        if(selection.HasChildShapeRange == true){
            selection.ChildShapeRange.Fill.Patterned(msoPatternDivot)
        }
        else{
            MsgBox("This is not a range of child shapes.")
        }
}

ChildShapeRange 属性 子形状区域


请参阅