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 20-02-2004, 18:08
RobC
Guest
 
Posts: n/a
Default Late-Binding Question

Hello Everyone-

I need to drive CorelDraw via COM. My VB app needs to talk to Draw versions 9,10,11,12. Since I don't know at compile time what version my users will be running, I can't early-bind the coreldraw object . Instead, I intend to use late binding like:

Code:
Private Sub command1_click()
Dim myObj As Object

Set myObj = CreateObject("coreldraw.application")
MsgBox myObj.version

End Sub
Is there a way I can specify the object (9,10,11,or 12) that I am instantiating? Some folks may have multiple versions on the same machine, and it may be a crap-shoot as to which one gets fired off. The code above falls short in this respect.

Any ideas?

Thanks,

Rob Cohen
Reply With Quote
  #2  
Old 20-02-2004, 20:52
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Late-Binding Question

Sure you can. The object name "CorelDRAW.Application" stands for the application version which was installed last. However the rest of the versions can still be instantiated by specifying the version number explicitly:

Code:
Set myObj = CreateObject("CorelDRAW.Application.10")
or
Code:
Set myObj = CreateObject("CorelDRAW.Application.11")
Well, you've got the idea
Reply With Quote
  #3  
Old 20-02-2004, 21:57
RobC
Guest
 
Posts: n/a
Default

Thanks Alex, thats exactly what I needed.

Curiously (and the reason I asked in the first place), a user reported that v10 was getting launched by the generic call, even though v11 and v12 were installed on the machine as well, and v10 hadn't been used in months. In any case, this should not be an issue as long as I specify the version.
Reply With Quote
  #4  
Old 27-02-2004, 06:32
VyperOne
Guest
 
Posts: n/a
Default Multiple Versions

Adding my two cents to the question...

I had found out early on that when there were two versions of Corel ( especially 10 and 11 ) installed on the customers PC my applications written in VB did not perform correctly. I also found out that code changes were needed between versions to make up for errors in the Corel object model. This made having one code set impractical so I maintained different code sets for each version. Maybe I was doing something wrong all along but...
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
condensing text question bbolte CorelDRAW/Corel DESIGNER VBA 6 09-04-2005 22:33
Icon Question dungbtl CorelDRAW/Corel DESIGNER VBA 0 17-03-2005 17:37
CreateArtisticText question...... sejal01 CorelDRAW/Corel DESIGNER VBA 1 01-01-2005 14:01
Question about toolbar -=HKLC=- CorelDRAW/Corel DESIGNER VBA 1 16-10-2004 14:33
The CommandBar to linke the VB Form question levin CorelDRAW/Corel DESIGNER VBA 1 24-08-2003 12:40


All times are GMT -5. The time now is 20:59.


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