Previous Document Next Document

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


Shape.UngroupEx

Function UngroupEx() As ShapeRange

Description

Member of Shape

The UngroupEx method ungroups all shapes in a specified group and returns the ungrouped shapes as a shape range (or ShapeRange object).

VBA example

The following VBA example creates two circles and builds a blend between them. The blend is separated, while the blend steps are ungrouped and scattered randomly.

Sub Test()
 Dim s1 As Shape, s2 As Shape
 Dim s As Shape
 Dim g As ShapeRange, stps As ShapeRange
 Set s1 = ActiveLayer.CreateEllipse(0, 0, 2, 2)
 s1.Fill.UniformColor.RGBAssign 255, 0, 0
 Set s2 = ActiveLayer.CreateEllipse(6, 6, 7, 7)
 s2.Fill.UniformColor.RGBAssign 255, 255, 0
 s1.CreateBlend s2
 Set g = s1.Effects(1).Separate
 Set stps = g(1).UngroupEx
 For Each s In stps
  s.Move (Rnd() - 0.5) * s.SizeWidth, (Rnd() - 0.5) * s.SizeHeight
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.