Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if MS Word is installed
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00415559
Message ID:
00415640
Vues:
33
>Hi all,
>
>Just wondering how I can determine (programmatically) if a user has MS Word 97 (or higher) installed on the pc which is running my app.
>
>I'm using Word to print charts from my app (generated with MSChart) by copying the chart object to the clipboard, then pasting that into a Word document and then sending it to the printer. Everything works fine, but I need to trap for users who don't have Word installed. (Actually I'd like to disable the print button for "Word challenged" users by testing in the beginning rather than waiting and trapping for an error)
>
>Any suggestions are appreciated. Also, I am curious if I have to test for all versions of Word or is there a standardized thing I can look for (regardless of if they have Word 2000, etc)
>
>Thanks in advance,

With:

oWord=createobject("Word.Application")
&& trapping error like Mike suggested

for the version is.

oWord.version

Word2000 is "9.0", don't know for Word 97, but you can check this.

A second try is searching in the registry.

The key
HKEY_CLASSES_ROOT\Word.Application\CurVer

returns "Word.Application.9" for Word 2000

See you.
Pablo Roca
Clavo Congelados, S.A. (La Coruna - Spain)
Sysop of PortalFox

Join MasFoxPro campaign
http://www.masfoxpro.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform