Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking the existence MS word for using OLE
Message
From
01/11/1998 21:19:29
 
 
To
01/11/1998 20:06:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00153327
Message ID:
00153338
Views:
23
>Hi~~~~ Every one....
>I'm always wishing your good lucks......
>
>I have a question about using OLE,
>By some advise, I can use MS Word OLE. : )
>
>but another problem is come back to me.....
>the very problem is that for using OLE , first "I MUST CHECK THE
>EXISTENCE OF SPECIFIC OLE AUTOMATION SERVER...."
>
>i'm using MS word OLE then,
>how can I check the existence of MS word....???
>
>Must I read registry in computer?
>then
>How can I read the registry???
>it's very serious for me.......
>
>thanks...
>I'll wait for your kindly reply A.S.A.P.

You can read the registry for this, but the quicest way to handle it is just to capture the error when you try to instantiate word.

lnOnError = ON('Error')

llNoWord = .F.
ON ERROR llNoWord = .T.
oWord = CREATEOBJECT('Word.Application')

ON ERROR &lcOnError
IF llNoWord
RETURN .F.
ELSE
* Word Stuff here
ENDIF

If you decide that you want to read the registry for this information instead, look here in the files section for a registry class, there is at least one (I think more) and they are very easy to use. You can check for the existence of MS Word by checking for the existence of "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Word for Windows"

(at least this is how it appears in my registry).
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform