Previous Document Next Document

Object Model Reference : Classes : S : Shape : Methods : Shape.RemoveFromContainer


Shape.RemoveFromContainer

Sub RemoveFromContainer([Level As Long])

Description

Member of Shape

The RemoveFromContainer method removes a shape from its PowerClip container.

 
If there are several nested PowerClip objects, you can remove a shape from several containers at a time by specifying the Level parameter value.

Parameter
Description
Level
Specifies the lowest level from which to remove the shape. The shape is removed from this level and all levels above it. This parameter is optional, and its default value is 0.

VBA example

The following VBA example removes all ellipses from all PowerClip objects on the current page.

Sub Test()
 Dim s As Shape, ss As Shape
 Dim p As PowerClip
 On Error Resume Next
 For Each s In ActivePage.Shapes
  Set p = Nothing
  Set p = s.PowerClip
  If Not p Is Nothing Then
   For Each ss In p.Shapes
    If ss.Type = cdrEllipseShape Then
     ActiveDocument.ClearSelection
     ss.RemoveFromContainer
    End If
   Next ss
  End If
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.