OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Accesing CorelDraw 10 VBA Object Model without running it (http://forum.oberonplace.com/showthread.php?t=317)

dolmos 16-12-2003 06:42

Accesing CorelDraw 10 VBA Object Model without running it
 
Hi!

I will explain my problem the best I can.

I've to open, visualice and print CDR archives without opening it directly with CorelDraw. I mean, I need to do this into another aplication, I can't run CorelDraw in my system, but I can install it.

I think I could write a VBA code which accesing the CorelDraw libraries and his Object Model allows me to do that, but always with CorelDraw closed.

Is it possible ? where can find info about it ?

I don't know if I explained correctly, but any question will be wellcome.

Alex 16-12-2003 08:35

Re: Accesing CorelDraw 10 VBA Object Model without running i
 
It all depends on the definition of an application being running. Strictly speaking, it is NOT possible to use any of the automation interfaces without the server application running. That's just the way it is. Someone just must respond to your request. Methods cannot execute themselves.

However of you look at it from an end-user standpoint, then you can make CorelDRAW run in background so it is not visible to the user and still process your documents.

When you connect to CorelDRAW from another process (such as a stand-alone Visual Basic program), then the first thing Windows does is to find out if CorelDRAW is already running on the system. If it is, then your application just connects to it and everything is as usual. However if CorelDRAW is NOT running, then Windows will start it first. But the difference is that the application is started in background, so you won't see any of its windows, etc. You can process documents, then shut down the application without the user ever knowing that it was launched (unless he is using Task Manager to check what processes are running on the system).

You can, of course, make CorelDRAW visible after it was automatically started. You just need to set the Visible property of the Application object to True:

Code:

Dim Draw As Object
Set Draw = CreateObject("CorelDRAW.Application.11")
Draw.Visible = True

This will ensure that CorelDRAW is launched and it is visible. Alternatively, you can hide a running instance of the application by setting the Visible property to False, but that might not be that great of an idea because the user might be confused by the application suddenly disappearing.

I hope this helps. If you have any more questions, please let me know.

dolmos 16-12-2003 10:59

Of course it helps, thanks a lot. At least I notice that it's not possible to do that without CorelDraw running.

It's quite possible that the other way (executing CD10 in background) may be an option. It couldn't be too complicated to open a CDR file, visualize and print it using VBA interfaces, could be?

bbolte 18-12-2003 09:21

Quote:

Originally Posted by dolmos
It couldn't be too complicated to open a CDR file, visualize and print it using VBA interfaces, could be?

nope, do it all the time.

dolmos 19-12-2003 02:25

It's true it's easy to open and print documents with VBA in CD10, but question is that I want to do it from another application.

I want to design a VBA module (librarie) which provides methods that could be used for another application. Besides CD10 will do the "hard Work" in background I want show the results (the image) in my application.

For example, a simple Form in VB with two commandButtons, one for loading and visualizing the image, and one for printing it. And a "image area" to visualize the CDR archive in.

I'll try to do that if it's possible. Any idea of what VB object could I use to see the CDR image ?

bbolte 19-12-2003 07:52

i've used the internet components to see a gif/jpeg file "thumbnail" that i've exported from the corel doc. outside of that, i don't think it's possible to view the actual corel file.


All times are GMT -5. The time now is 03:35.

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