open a document not with the associated application

  • how can i open a tif document with a specific application other then the associated application?

  • right click and select open with and then select app that u wanna use.

  • i mean openning the file with the associated application by code.

    the selected associated application through windows can be changed out side my app, and i want to control it.

     

  • Take a look at the Shell command. Use something like this...

    Dim dblTaskID As Double, strCommandLine As String

    strCommandLine = "C:\WINDOWS\MyProgram.exe C:\Documents\file.tif"

    dblTaskID = Shell (strCommandLine, vbMaximizedFocus)

    ... dblTaskID = 0 if it fails, otherwise you get the Task ID. The second argument is optional, but you can use it to control the window style.

  • thank you

     

  • Is it not as easy as right clic the file and choose "open with" ?

  • if you wan to inssure that your file will open by a specific associated app even if it was changed to another one, you need it

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply