Results 1 to 4 of 4

Thread: Default program for apps

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Posts
    26

    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?

  2. #2
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    Check "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Extensions" in the registry I think that is it

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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:
    1. Process.Start("c:\myword.doc")

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Posts
    26
    Sweet. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width