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 21-01-2011, 23:45
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default X5: Find the name of the layer above a particular layer

If I have a master layer named "back" how can I find the name of the layer above it on page 1? I'm finding X5's stacking order hard to deal with. Thanks.

Chris
Reply With Quote
  #2  
Old 22-01-2011, 08:15
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
I haven't tested but hopefully these will help:

Code:
Sub layerTestCode()
    Dim i As Integer
    For i = 0 To ActivePage.Layers.count
        Debug.Print ActiveDocument.Pages(1).Layers(i).Name
    Next i
    
End Sub

Sub layerFindIt()
    Dim l As Layer, bfound As Boolean
    For Each l In ActiveDocument.Pages(1).Layers
        If bfound Then MsgBox "LAyer before is: " & l.Name: Exit For
        If l.Name = "Back" Then bfound = True
    Next l
    If Not bfound Then MsgBox "Layer not found"
End Sub
-John
Reply With Quote
  #3  
Old 22-01-2011, 09:59
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks John, I'm not sure what the first sub does and I can't figure out how the second is working but it does seem to be giving me useful results. Thanks very much. I'm very close now to being able to automatically reorder layers across a whole document based upon the layer order of the active page. With a bit more effort I think I might be able to get X5 to be almost as good as CD12!

Cheers,

Chris
Reply With Quote
  #4  
Old 22-01-2011, 13:00
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Quote:
Originally Posted by knowbodynow View Post
With a bit more effort I think I might be able to get X5 to be almost as good as CD12!

Cheers,

Chris
...lol

Yep. Certain things about older versions sure leave an impression that sticks!

Have a good weekend.
-John
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
Find the layer of the activeshape knowbodynow CorelDRAW/Corel DESIGNER VBA 3 22-01-2011 08:17
Shaperange to Layer ebu CorelDRAW/Corel DESIGNER VBA 2 19-01-2008 04:44
Layer Name in CorelDraw 7.0 Jab CorelDRAW CS 2 28-10-2005 00:05
1 color by layer 835 General 2 09-08-2005 03:41
Layer Script Hernán New product ideas 0 18-04-2004 18:10


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


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