Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if MS Word is installed
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00415559
Message ID:
00415788
Views:
29
>>I hate the "trap error" routine for trying to make a determination such as this. I'd use the registry class and check for the existence of the Word.Application key under HKEY_CLASSES_ROOT. Then again, that's just me.
>
>But checking the registry only check to see if the class is registered. It doesn't ensure that the user didn't decide she likes WordStar better and delete the content of the Word folder.
>
>IOW, the error trapping routine is a catch-all, and checking the registry just checks the best clue...

Don't buy it, Erik. Assuming that you've got an existing file name
DECLARE INTEGER FindExecutable IN Shell32;
  STRING @lpFile, STRING @lpDirectory, STRING @lpResult
* lcfile is the fully qualified file name of the type you're looking for
lcbuffer = SPACE(260)
IF FindExecutable(@lcfile, 0, @lcbuffer) > 32
  lcbuffer = LEFT(lcbuffer, AT(CHR(0), lcbuffer) - 1)
  ? FILE(lcbuffer)
ENDIF
Determines both the associated application and whether or not it exists.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform