![]() |
#1
|
|||
|
|||
![]()
Hi,
I am new to VBA programming and probably only an average CorelDRAW user. I recently bought the Corel X4 Suite. I am trying to automate some tasks and am taking baby steps. I need to loop through all the layers of the master page. Below are two methods - the second works while the first does not. I would prefer the first method. I get an error (run time error 91 - Object variable or With block variable not set) and I can see "l" is Nothing in the stack window. Any help would be appreciated. Dim l as Layer Dim currIdx As Integer For currIdx = 1 To ActiveDocument.MasterPage.Layers.Count Step 1 l = ActiveDocument.MasterPage.Layers.Item(currIdx) 'error 91 here Debug.Print "Layer name = " & l.Name Next currIdx For Each l In ActiveDocument.MasterPage.Layers Debug.Print "Header name = " & l.Name Next l Thank you, Joe |
#2
|
|||
|
|||
![]()
I think I figured it out:
For currIdx = 1 To ActiveDocument.MasterPage.Layers.Count Step 1 Set l = ActiveDocument.MasterPage.Layers(currIdx) Debug.Print "Layer name = " & l.Name Next currIdx Joe |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Layers in Corel X3 | Sally | General | 2 | 15-03-2007 17:39 |
layers | signweld | General | 2 | 09-03-2007 13:40 |
How controll lot of layers? | petig | CorelDRAW/Corel DESIGNER VBA | 5 | 28-08-2005 03:35 |
Simple Loop? | dan | CorelDRAW/Corel DESIGNER VBA | 3 | 13-10-2004 14:31 |
Send to layers | click101 | CorelDRAW/Corel DESIGNER VBA | 4 | 14-09-2004 03:46 |