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 24-02-2007, 17:45
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Copy Selected Objects to new page maintaining layers

Hello,

I have the following code which copies selected objects to the next page while maintaining layers:

Code:
sub copytonext()

Dim sr As ShapeRange
Dim s As Shape

Set sr = ActiveSelectionRange

For Each s In sr
s.Layer.Activate
s.Duplicate

s.MoveToLayer ActiveDocument.Pages(ActivePage.Index + 1).ActiveLayer
Next s

End Sub
How do I change this so that the objects are copied to a new page inserted after the current page?

Thanks,

Chris (Hunt)
Reply With Quote
  #2  
Old 26-02-2007, 17:19
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,782
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Copy To Next Page

How about something like this:
Code:
Sub CopyToNext()
    Dim sr As ShapeRange
    Dim s As Shape
    Dim p As Page

    Set sr = ActiveSelectionRange
    Set p = ActiveDocument.InsertPages(1, False, ActivePage.Index)

    For Each s In sr
        s.Layer.Activate
        s.Duplicate
        s.MoveToLayer ActiveDocument.Pages(ActivePage.Index + 1).ActiveLayer
    Next s
End Sub
Shelby
Reply With Quote
  #3  
Old 26-02-2007, 20:54
vindaa
Guest
 
Posts: n/a
Default Excelent

Hey !!!
Great idea, This can be very very useful. Using 'duplicate' instead of Copy makes it much much faster even for large bitmaps. Great.

Only one thing, if you can add something by which I get an option of selecting page number whiere I want it copied to. It would be far more useful. Please.

Thanx
Reply With Quote
  #4  
Old 26-02-2007, 22:13
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks Shelby, that works beautifully. I had worked out something that involved
ObjectData("Name") but your method is much simpler.

Best wishes,

Chris
Reply With Quote
  #5  
Old 27-02-2007, 21:51
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Quote:
Originally Posted by vindaa
Hey !!!

Only one thing, if you can add something by which I get an option of selecting page number whiere I want it copied to. It would be far more useful. Please.

Thanx
Hello, I just uploaded an attachment here:

http://forum.oberonplace.com/showthr...=8160#post8160

The macro is rough but I think (I hope) it does what you want.

Best wishes,

Chris (Hunt)
Reply With Quote
  #6  
Old 07-03-2007, 08:49
vindaa
Guest
 
Posts: n/a
Default Works Great

Thanx, I just tried it today. It was very thoughfull of you to add all those options.!!! Great.

For those wonking with multiple layers this will be very useful.
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
Is there a way to select all objects on page..... LGD CorelDRAW/Corel DESIGNER VBA 2 10-11-2006 14:04
How controll lot of layers? petig CorelDRAW/Corel DESIGNER VBA 5 28-08-2005 02:35
Deselect all selected objects Alex FAQ 1 16-05-2005 14:10
Copy and paste objects in CDR9 macnab CorelDRAW/Corel DESIGNER VBA 0 03-09-2003 10:59
I need to update objects visibility faster NEHovis Corel Photo-Paint VBA 0 18-07-2003 07:54


All times are GMT -5. The time now is 08:11.


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