Propiedad Selection.HasChildShapeRange (PowerPoint)

True si la selección contiene formas secundarias. Solo lectura.

Sintaxis

expresión. HasChildShapeRange

Expresión Variable que representa un objeto ParagraphFormat .

Valor devuelto

Booleano

Ejemplo:

En este ejemplo se crea una diapositiva con un lienzo de dibujo, se rellena el lienzo con formas y se seleccionan las formas agregadas al lienzo. A continuación, una vez que se comprueba que las formas seleccionadas son formas secundarias, se rellenan dichas formas con un diseño.

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

Consulte también

Objeto Selection

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.