OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19-10-2014, 01:10
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Delete Objects from a defined area X6

I'd like to be able to select an object on one page and then delete all objects on other pages that are within the same space. I tried the following but it is not working:

Code:
Sub DeleteFromSelectedOnOtherlPages()

Dim p As Page, s As Shape, n As Integer
Dim x As Double, y As Double, w As Double, h As Double

ActiveDocument.ReferencePoint = cdrBottomLeft
ActiveDocument.Unit = cdrMillimeter

n = ActivePage.Index

ActiveDocument.selection.GetBoundingBox x, y, w, h, True

For Each p In ActiveDocument.Pages

    If p.Index <> n Then
    
        Set s = p.SelectShapesFromRectangle(x, y, w, d, True)
        If s.Shapes.Count >= 1 Then s.Delete
        
    End If

Next p

End Sub
It seems that SelectShapesFromRectangle is failing. Can anyone think of an alternative solution. Thanks.
Reply With Quote
  #2  
Old 19-10-2014, 01:44
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Found the problem with the SelectShapesFromRectangle. It should read:

Code:
Set s = ActivePage.SelectShapesFromRectangle(x, y, x + w, y + h, False)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all off-page objects gorgo2 Macros/Add-ons 8 18-08-2010 11:09
delete text at specific area on all pages? gorgo Macros/Add-ons 4 18-05-2010 20:27
Delete matching objects click101 CorelDRAW/Corel DESIGNER VBA 2 02-06-2008 17:14
Delete small objects macro Jeff Harrison New product ideas 3 19-05-2007 13:19
Delete All Nodes in Selected Area JudyHNM CorelDRAW/Corel DESIGNER VBA 8 09-05-2007 18:50


All times are GMT -5. The time now is 10:20.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com