|
-
Oct 8th, 2003, 12:19 PM
#1
Thread Starter
Junior Member
Default program for apps
Is it possible to find what the default application is for a particular program and then run it with VB?
For instance is it possible to find out what the default program would be for manipulating DOC files (like if the user has StarOffice or uses wordpad, etc) and then find where that program is located in order to open doc files on it from the Shell command in VB?
Example:
User1 uses Wordpad for editing DOC files
User2 uses StarOffice
User3 uses Word
I know you can use VB to open DOC files in Word, but what if the user does not have Word? I want to be able to allow the user to edit the DOC file in whatever is his/her default DOC editor and so that's where my question comes into play.
Is it possible to find the default application that handles certain extentions?
If so, is it possible to find the path to run the application?
Would the SHELL command still work in order to run the application?
-
Oct 8th, 2003, 12:26 PM
#2
Addicted Member
Check "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions" in the registry I think that is it
-
Oct 8th, 2003, 12:28 PM
#3
You can use Process.Start (in the System.Diagnostics namespace) to run a file by its default associated application. This works basically the same as the ShellExecute API (it probably is just a wrapper for it).
VB Code:
Process.Start("c:\myword.doc")
-
Oct 13th, 2003, 11:42 AM
#4
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|