CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Location
    US NJ
    Posts
    113

    Opening an application

    I have the path of the text file, How am I going to open this text file in the notepad using vb. What should I use to tell to program open the notepad and put this text file in it. Or open an image in the Kodak viewer using VB. I know it's not shell bcause shell opens the program but it doesn't put the file in it.
    Please help

    Leo


  2. #2
    Join Date
    Feb 2000
    Posts
    137

    Re: Opening an application

    You can use the shell command - it's first argument (although called pathname in the documentation) is used to pass the entire command line of the program being called so if your file were c:\Text.txt you could use:


    Shell ("notepad.exe c:\Text.txt", vbNormalFocus)




    This will launch notepad and pass to it the file c:\Text.txt. Keep in mind that the Shell command executes the called program asynchronously - that means that your program will continue with the next line immediately. The Shell command returns the TaksID of the program that you launched which can be used with the Windows API to monitor when that program exits.


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

Featured