Results 1 to 3 of 3

Thread: [RESOLVED] Utilize Open With dialog

  1. #1

    Thread Starter
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    Resolved [RESOLVED] Utilize Open With dialog

    I'm having the reverse problem as this thread.
    We save off data in several formats, one of which is .XLS, however, some users may not have MS Office installed already, so I want to allow them to use the OS's "open with" dialog to associate with notepad or something so they can open the file.

    Currently we open the file with code like this:
    Code:
    Proc.StartInfo.WorkingDirectory = sFile_
            Proc.StartInfo.FileName = Proc.StartInfo.WorkingDirectory 
            Proc.StartInfo.UseShellExecute = True
            Proc.Start()
    Currently the result of an un-associated .xls file is an ugly error.

    Thanks
    -JP
    Merry Christmas

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Utilize Open With dialog

    try this:

    vb Code:
    1. Process.Start("RUNDLL32.EXE", "shell32.dll,OpenAs_RunDLL " & FileName)

  3. #3

    Thread Starter
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    Re: Utilize Open With dialog

    Thank you.

    Just ran a search on RunDLL32.EXE, very useful stuff there.
    Merry Christmas

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