Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Window Scripting Host
Message
From
28/03/2002 12:36:13
 
 
To
27/03/2002 18:46:54
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00638196
Message ID:
00638545
Views:
23
>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?

You can use the _ShellExecute class provided in the Fox Foundation Classes (FFC) that came with VFP - it's in the VCX _environ.VCX in the FFC subfolder of your copy of VFP. You can also call the ShellExecute() Windows API directly, use the WSH Wscript.Shell Run() method, or the Shell.Application Open() method to do this.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform