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 01-06-2007, 20:03
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 430
Default Copying Objects From Master Layers?

How can I copy all objects on a particular master layer to another layer?

The following doesn't work if the active layer is a master layer.

Code:
Sub allcopy()

Dim p As Page, s As Shape

For Each p In ActiveDocument.pages
    
        For Each s In p.ActiveLayer.Shapes
    
        s.CopyToLayer p.Layers("Imagesave")
        
        Next s
        
Next p

End sub
I'm using CorelDraw 12.

Thanks,

Chris (Hunt)
Reply With Quote
  #2  
Old 01-06-2007, 22:35
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

master layer shapes appear on all pages, so they should be probably accessed by (0) page index
this may work:
Code:
for each s in ActiveDocument.pages(0).Layers(<<MasterLayerName>>)
........
next

Last edited by wOxxOm; 01-06-2007 at 22:37.
Reply With Quote
  #3  
Old 01-06-2007, 23:21
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 430
Default

Thanks for the reply, Os. I tried but couldn't get it to work.

Chris
Reply With Quote
  #4  
Old 01-06-2007, 23:22
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

it was a buggy sketch, should be:
Code:
for each s in ActiveDocument.pages(0).Layers(<<MasterLayerName>>).Shapes
........
next
Reply With Quote
  #5  
Old 02-06-2007, 02:38
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 430
Default

Sorry, I should have said I tried that as well. I've also tried masterpage instead of pages(0) but just can't get anything to work. It seems either there's a bug or something wrong with my CorelDraw.

Chris
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
Copy Selected Objects to other pages maintaining layers knowbodynow Code Critique 6 13-12-2015 18:46
Problem moving objects to master layer knowbodynow CorelDRAW/Corel DESIGNER VBA 2 23-05-2007 18:33
Copy Selected Objects to new page maintaining layers knowbodynow CorelDRAW/Corel DESIGNER VBA 5 07-03-2007 08:49
Count objects in active selection on master layer knowbodynow CorelDRAW/Corel DESIGNER VBA 7 27-02-2007 21:48
Handling objects on Master Pages akayani CorelDRAW/Corel DESIGNER VBA 6 27-03-2006 18:16


All times are GMT -5. The time now is 01:28.


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