WPS 基础接口 > 演示 API 参考 > Selection > 属性 > ParagraphFormat.HasChildShapeRange 属性
如果选定范围包含子形状,则为只读 TrueBoolean 类型。

语法

表达式.HasChildShapeRange

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

返回值
Boolean

示例

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

示例代码
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.")
        }
}

has child shape range haschildshaperange 属性


请参阅