Results 1 to 3 of 3

Thread: Open file with a specific application (Resolved)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    Open file with a specific application (Resolved)

    Currently I use ShellExecute to open files, which only works if the file extension is known by windows.

    Problem: When the file extension is unknown I still want the file to be opened.

    Code:
    ShellExecute 0&, vbNullString, arrayfullpath(mn), vbNullString, vbNullString, 1
    Would like to open with notepad or possibly a right click "open with..." menu.


    Thanks, I appreciate any help!
    Last edited by kevininpsu; Jul 8th, 2004 at 03:18 PM.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Not sure if I understand properly, but I think you want:
    VB Code:
    1. Shell "notepad C:\File.file"
    You need double quotes around it if you have a filename with a space in it:
    VB Code:
    1. '1
    2. Shell "notepad """C:\Documents and Settings\Admin\My Documents\file.bla"""
    3.  
    4. '2
    5. Shell "notepad " & Chr(34) & "C:\Documents and Settings\Admin\My Documents\file.bla" & Chr(34)
    I don't think bla is an extension for any program

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    28

    Thanks

    Thanks Phreak, works well. I need a drink after reading the True False code in your signature. Peace.

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