Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Window Scripting Host
Message
De
28/03/2002 08:48:44
Steve Summers
Pima County Superior Court
Tucson, Arizona, États-Unis
 
 
À
27/03/2002 21:20:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00638196
Message ID:
00638368
Vues:
22
>>I need to be able to launch different files from VFP. For instance, I need to code a command button to launch Word or WordPerfect depending on the file type. In the Windows Run window I can point to a .wpd and it will open WordPerfect with the .wpd file. When I point the Window Run window at a .doc file it opens Word and the .doc file. I need this same functionality from VFP using a command button. Someone told me to use WSH to do this. Does anyone have any WSH code or even a better method to do this?
>
>
>
>#define SW_SHOW_NORMAL 1
>#define SW_SHOW_MINIMIZED 2
>#define SW_SHOW_MAXIMIZED 3
>oShell = createobject("WScript.Shell")
>oShell.Run("c:\my documents\myfile.doc",SW_SHOW_NORMAL,.T.)
>
>where the last parameter is .T. to run synchronously, that is for VFP to wait for the called program to end before continuing.

Thanks for your help!
Thanks in advance or I hope this helps!

[STS]
:>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform