>I am looking for a way to reliably detect (in the Registry) the installation of Word'97 so I can use its spell-checker in my app. The best suggestion I have seen so far is to use the app associated with .doc via the code at the bottom of this post. The downside
>
>
> declare long FindExecutable in "shell32.dll" ;
> string cFile, string cDirectory, string @cResult
> cBuffer = space(255)
> nRetVal =
> FindExecutable("testit.doc",getenv('temp') , @cBuffer)
> if nRetVal < 32
> messageBox("You don't have Word installed.",64,;
> 'File Opening Problem')
> return
> endif
>
>
>The problem is that if a user has the Word Viewer installed, it will still return true; the same could be said if someone has WordPro installed....
Instead of checking the return value, check the value of cBuffer after the call is made. It will contain the full path to the executable registered as the default viewer. So you can:
nRetVal = FindExecutable("c:\somedoc.doc",getenv('temp') , @cBuffer)
llHasWord = LOWER(JUSTFNAME(cBuffer)) = "winword.exe"
Erik Moore
Clientelligence