Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking the existence MS word for using OLE
Message
 
 
To
01/11/1998 21:19:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00153327
Message ID:
00153416
Views:
21
Unless the created instance of the COM Server will stick around - reading the registry is the way to go!! CreateObject will work, but it is slow - especially since the the object instance gets destroyed anyway.

BTW, have you checked out the Windows Scripting Host yet for reading the registry???

>>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).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform