Object Model Reference : Classes : P : Page : Methods : Page.SelectShapesFromRectangle |
Function SelectShapesFromRectangle(x1 As Double, y1 As Double, x2 As Double, y2 As Double, Touch As Boolean) As Shape
Member of Page
The SelectShapesFromRectangle method selects all shapes within a given rectangle as if selected with a marquee.
This method creates a new selection and returns the selection-shape object.
The following VBA example allows the user to pick a color, which is used to fill all shapes in a defined area. This procedure repeats until Esc is pressed.
Sub Test() |
Dim d As Document |
Dim sel As Shape, s As Shape |
Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double, Shift As Long |
Dim c As New Color |
Set d = ActiveDocument |
c.UserAssign |
While d.GetUserArea(x1, y1, x2, y2, Shift, 100, False, cdrCursorWinCross) = 0 |
Set sel = d.ActivePage.SelectShapesFromRectangle(x1, y1, x2, y2, False) |
For Each s In sel.Shapes |
s.Fill.ApplyUniformFill c |
Next s |
Wend |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.