Late Bind to Specific version of Application

J

jason

I'm running the below code:

Dim strApp As String
strApp = "Word.Application"
'check to see if Word is running
If Not IsRunning(strApp) Then
Set WordApplication = CreateObject(strApp)
Else
Set WordApplication = GetObject(, strApp)
End If
strApp = ""

ANYWAY TO MAKE SURE IT ONLY BINDS ONTO A SPECIFIC VERSION OF WORD IF
TWO VERSIONS ARE INSTALLED ON THE MACHINE?

any help greatly appreciated

Jason
 
K

keepITcool

the 'VersionIndependentProgId = "word.application"

you could try to use "Word.application.10"
have a look at the registry hive

HKEY_CLASSES_ROOT\CLSID\{000209FF-0000-0000-C000-000000000046}


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
J

jason

ahhh...the spiral Man!

KeepItCool can you explain what a "hive" is and how looking at it will
help me: if its all a bit involved and involves a big explanation then
can you point me in the direction of an explanation

looking forward to hearing from you

Jason
 
K

keepITcool

Jason,

a hive is another word for a registry key (and its subkeys)

in a normal install you'll get the most recent version
regardless what you call:

(unless maybe there's RUNNING instances of 2 different versions?, when
you might be able to call GetObject(,"word.application.10")
Sorry, I can't test at the moment

Isn't it enough to check which version you've got, once you've set your
variable?





keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
T

Tom Ogilvy

You need to do more testing Jason. .10 on the end does nothing according to
articles published by Microsoft. The last version registered will be the
version used by GetObject.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top