OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 17-10-2003, 12:57
Posts: n/a
Default function delete after duplicate

I have an object named Rect1
"Set Rect1 = ActiveShape"
I select all objects of the page and I duplicate

For Counter = 1 To (NumberX - 2)
ActiveShape.Duplicate 0, (DimY * Counter)
Next Counter
When I duplicated X time and that I want to suppress the "Rect1" objects, he/it only suppresses the first.


how to make to erase all Rect1 ?
Reply With Quote
Old 17-10-2003, 14:42
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: function delete after duplicate


When you call Shape.Duplicate, it returns you the newly created shape. You can assign it to a variable or store in a shape range. For example:

Dim s As Shape
Dim sr As New ShapeRange

Set s = ActiveShape
For i = 1 to 10

    Set s = s.Duplicate(...)
    sr.Add s ' Add the new shape to ShapeRange
Next i
sr.Delete ' Delete all shapes stored in the shape range
Reply With Quote
Old 18-10-2003, 00:35
Posts: n/a
Default Re: function delete after duplicate

It is a little more complicated than your answer, certainly Interesting, that will serve to me subsequently.
I have a Rect1 object well but with other included objects.
I duplicate all objects, but at the end I want to suppress the Rect1 object and these duplications only. I cannot use:
Set s = ActiveShape since it regroups Rect1 and the other objects.
Reply With Quote

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
how to use getpixel() to get the Image color? lees CorelDRAW/Corel DESIGNER VBA 6 17-10-2004 00:13
Printing Raw Prn Files Mark Code Critique 2 16-09-2004 16:15
Function names Lev Oberon Function Plotter 1 29-08-2003 11:04
How can I get data from function? Elie CorelDRAW/Corel DESIGNER VBA 3 15-05-2003 05:08
takes Draw a long time to start a new document! bbolte CorelDRAW/Corel DESIGNER VBA 5 14-05-2003 09:09

All times are GMT -5. The time now is 16:17.

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