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 19-02-2004, 04:48
ama
Guest
 
Posts: n/a
Default How to get objects from another opened corel document

I'm making some corel document, and then i want to create by VBA another document where (again by VBA) i want to operate objects from original doc (of course place them there, and calculate their sizes, positions using their sizes an positions in original file)

How can i do this?
Reply With Quote
  #2  
Old 19-02-2004, 08:40
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: How to get objects from another opened corel document

Again, I'm not quite sure what exactly you are trying to do. Could you explain it in more details? Try to explain it on a step-by-step example, something like:

- I want to create a document and create two rectangles in it
- Create another document and copy the first rectangle from the first document into it.
- Fill the rectangle in the second document with red.
- Get the size of the rectangle
- Make the second rectangle in the first document the same size.

Something like that. Or, maybe, describe your problem and we'll try to see what should be done to resolve it.
Reply With Quote
  #3  
Old 19-02-2004, 09:19
ama
Guest
 
Posts: n/a
Default

ok.
1. I am making first document. There i draw several graphics and write some text (next it will be converted to graphics too). This file is the preview of some production unit - PVC cap for alcoholic industry.
This unit is truncated cone made of PVC with some pictures on its sides
This pictures i am drawing. Preview is planar, - i am drawing my pictures on a broach, which on a preview step is simple a rectangle

2. After the preview is made i have to make an exact broach, from which one my production unit will be made. at this step broach is not a rectangle. Now it is a segment of a circle. all pictures and text must placed there, moved and rotated at some angles.

3. So, i create my second document and i want to place there all graphics from the first one and distribute graphics according to its position in the first document.

I read VBA reference but i did not find way to get access to objects and their properties laying in another opened in corel document (but not active)
Reply With Quote
  #4  
Old 19-02-2004, 09:22
ama
Guest
 
Posts: n/a
Default

sorry, first wrote to wrong topic
Reply With Quote
  #5  
Old 20-02-2004, 02:07
ama
Guest
 
Posts: n/a
Default

question fof alex -
have you ever been to russia?
im asking because your name seem's to be russian.
If you speak russian - please contact me - ama1@tut.by
or ICQ - 162709707
Reply With Quote
  #6  
Old 20-02-2004, 20:55
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Well, actually I'm from the Ukraine And yes, I can speak both Russian and Ukrainian.
Reply With Quote
  #7  
Old 24-02-2004, 03:14
ama
Guest
 
Posts: n/a
Default

Dim s5 As Shape
Set s5 = Apllication.ActiveDocument.ActiveLayer.Shapes(1)
- this construction works

Set s5 = Apllication.Document(1).ActiveLayer.Shapes(1)
- this is NOT wirking
I can get access only for objects and their properties/methods in active document. But when i am trying to access another opened document using common implicit property item(or Document(1)), which is the same)
- i get "error 424. Object required"
Apllication.Document.Item(1).Unit=cdrMillimeter - does NOT working

How can I fix It?
Reply With Quote
  #8  
Old 24-02-2004, 03:26
ama
Guest
 
Posts: n/a
Default

Dim d5 As Document
Set d5 = Apllication.CreateDocument() -
also does NOT working.

Help! What am I doing wrong?
Reply With Quote
  #9  
Old 24-02-2004, 03:35
ama
Guest
 
Posts: n/a
Default

Dim d5 As Document
For Each d5 In Apllication.Documents
...
Next d5
- does NOT working
Reply With Quote
  #10  
Old 24-02-2004, 03:40
ama
Guest
 
Posts: n/a
Default

This what is said in "VBA Programming guide fir Corel11":

"Whenever a CorelDRAW(CDR) file is opened, a new Document object is created in the Application object for that document. Application contains a collection, Documents, that provides access to all of the open documents."

So why if it "provides access to all of the open documents" i cant get this access?!
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 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


All times are GMT -5. The time now is 10:36.


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