Opening text file using VB 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • witchiz brews
    New Member
    • Apr 2006
    • 1

    Opening text file using VB 6.0

    Hi

    Code:
    ShellExecute Me.hwnd, "open", "notepad", currentFileName, vbNullChar, SW_NORMAL
    I know the aboce code forces my .txt file to open up in notepad.
    However, i want to open it into another program called ABC.exe.
    ABC.exe is not a windows programme.
    How do i make the file open in ABC.exe?
    I am currently using VB 6.0.

    Help would be gladly welcomed.
    Thanks
  • Socheat
    New Member
    • Apr 2006
    • 7

    #2
    Originally posted by witchiz brews
    Hi

    Code:
    ShellExecute Me.hwnd, "open", "notepad", currentFileName, vbNullChar, SW_NORMAL
    I know the aboce code forces my .txt file to open up in notepad.
    However, i want to open it into another program called ABC.exe.
    ABC.exe is not a windows programme.
    How do i make the file open in ABC.exe?
    I am currently using VB 6.0.

    Help would be gladly welcomed.
    Thanks
    I looking as your, if u know tell me please?
    Thanks

    Comment

    • vb_help
      New Member
      • Jun 2006
      • 1

      #3
      Hello,

      The basic concept is that the file extension needs to be regsistered to open in particular application.
      By default txt files open in notepad.

      You want to open the txt files in your program, then you either change file associations programmaticall y or do manually.

      For manual procedure:
      Windows Explorer
      tools - folder options - file types

      then use shellexecute function


      Can you open txt file with this
      abc.exe file_path from Start - run

      If yes, then in the existing code you can replace notepad with abc.exe

      Hope it helps :)

      Comment

      Working...