Results 1 to 7 of 7

Thread: Launch Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Posts
    1

    Question Launch Application

    Can anyone tell me how I can open a file using a specified application. For example how would I open a txt file in MS Word. I know I can use Shell to open a file using the file associated application, but I am unsure how to specify the application I wish to use to open the file.


    Many Thanks

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    You can do something like this:
    VB Code:
    1. Shell "C:\Program Files\Microsoft Office\Office\WINWORD.EXE c:\test.txt", vbNormalFocus
    Roy

  3. #3
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by duc
    heres a link to what i learned

    http://vbforums.com/showthread.php?s...56#post1214156
    Duc stop posted to old threads.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Shellexecute may be what you want.

  6. #6
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    So does anybody know this or not?

    The question concerned opening a file when one does not know
    the associated application, or the path to the associated application.

    Like folks who hate microsoft and they go and delete the notepad.exe in leiu of {InsertFreeOfficePackageHere}.
    They then re-associate all their .txt,.log,etc with their editor of choice. How to open a .txt file from my VB6.0 using their preferred application.


    Digital Error post looks helpful, but I cannot seem to find any help with ShellExecute.
    Merry Christmas

  7. #7
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    Ah,

    It's an API Call.

    Nevermind. I got it.
    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