![]() |
#11
|
|||
|
|||
![]()
Ok. Seems I found the way.
First we have to do the folowing: Application.Documents(1).Activate Please tell me if it is right and the only way cause this action brings selected document to the front in the corel draw window. Is there a way to access document in the background? |
#12
|
||||
|
||||
![]()
I'm not sure if this is just your typing mistake but most of the above code samples you gave contain misspelled object names:
You should use "Application" instead of "Apllication" and "Documents" instead of "Document". Here is an example macro which works with shapes in both documents at the same time: Code:
Sub TestDocs() Dim doc1 As Document Dim doc2 As Document Dim n As Long Dim s As Shape Set doc1 = Application.CreateDocument Set doc2 = Application.CreateDocument For n = 0 To 3 doc1.ActiveLayer.CreateRectangle2 n * 2, 0, 1, 1 doc2.ActiveLayer.CreateRectangle2 n * 2, 0, 1, 1 Next n For Each s In doc1.ActiveLayer.Shapes s.Fill.UniformColor.RGBAssign Rnd() * 255, Rnd() * 255, Rnd() * 255 Next s For Each s In doc2.ActiveLayer.Shapes s.Fill.UniformColor.RGBAssign Rnd() * 255, Rnd() * 255, Rnd() * 255 Next s Set s = Application.Documents(1).ActiveLayer.Shapes(1) s.Move 0, 4 Set s = Application.Documents(2).ActiveLayer.Shapes(3) s.Move 0, 4 End Sub |
#13
|
|||
|
|||
![]()
well, now i know my mistakes
![]() great thanks, Alex! |
![]() |
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 |
document name and created date in Corel drawing | eric | CorelDRAW/Corel DESIGNER VBA | 5 | 14-09-2004 22:17 |
Corel 9 Absolute document path | mpp_piotrp | CorelDRAW/Corel DESIGNER VBA | 2 | 14-08-2004 00:23 |
Problem with opened dialog box Corel Draw 11 | dergy | CorelDRAW/Corel DESIGNER VBA | 1 | 14-06-2004 10:04 |
Corel Draw 9 Active Document | korner | CorelDRAW/Corel DESIGNER VBA | 2 | 17-04-2004 01:46 |
Copying objects to clipboard then closing document. | CORNMEN | CorelDRAW/Corel DESIGNER VBA | 4 | 31-03-2003 09:52 |