Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launch Unknown Document Types
Message
From
17/12/2002 12:14:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00733177
Message ID:
00733732
Views:
28
>You can use WSH http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRun.asp
oShell = CREATEOBJECT('WScript.Shell')
>oShell.Run(lcMyFile)
or ShellExecute API #12636.
>

There's also Shell.Application's Open method:
oShell=CREATEOBJ('Shell.Application')
oShell.Open(lcMyFile)
This will run under Win95 OSR2 v 2.1 or later, Win98, WinME, Win2K and WinXP IAC; it will also run under retail Win95 and WinNT 4.0 as long as at some point has had IE 4 or IE 4.01 with the Active Document extensions installed on it; later versions of IE (IE 5, 5.5 and 6.0) did not upgrade the Shell components on Win95/WinNT when they installed. If you have Win95 or WinNT and do not have Shell.Application, but have a version of I later than 4.01, you'll need to uninstall the current version, install 4.01, and then upgrade back to the most current version of IE, reapplying any SPs or HotFixes which were originally there.


>>I'm probably missing something obvious, but I haven't been able to find an answer to this here or on the Wiki, so a request for help from the more knowledgable:
>>
>>In a document management type scenario where I want my users to be able to launch (from my VFP application) a selected document of any type in whatever its registered application may be, but I don't know that in advance---is there a way to do it?
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
Next
Reply
Map
View

Click here to load this message in the networking platform