View Single Post
  #2  
Old 16-12-2003, 08:35
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default 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.
Reply With Quote