OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 24-02-2004, 05:02
ama
Guest
 
Posts: n/a
Default

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?
Reply With Quote
  #12  
Old 24-02-2004, 08:01
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

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
Reply With Quote
  #13  
Old 24-02-2004, 08:11
ama
Guest
 
Posts: n/a
Default

well, now i know my mistakes
great thanks, Alex!
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
document name and created date in Corel drawing eric CorelDRAW/Corel DESIGNER VBA 5 14-09-2004 23:17
Corel 9 Absolute document path mpp_piotrp CorelDRAW/Corel DESIGNER VBA 2 14-08-2004 01:23
Problem with opened dialog box Corel Draw 11 dergy CorelDRAW/Corel DESIGNER VBA 1 14-06-2004 11:04
Corel Draw 9 Active Document korner CorelDRAW/Corel DESIGNER VBA 2 17-04-2004 02:46
Copying objects to clipboard then closing document. CORNMEN CorelDRAW/Corel DESIGNER VBA 4 31-03-2003 10:52


All times are GMT -5. The time now is 05:22.


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