Results 1 to 6 of 6

Thread: open .TXT file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Post

    Thanks for the help here guys.

    And JazzBass, does your office really use VB3? God I pity you if so!

    thanks

    Andrew



    ------------------
    Andrew Nerney
    Hapless Programmer
    [email protected]

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Post

    Could someone show me the code to open a specific text file with Notepad or Wordpad? I know I can use the Shell command to launch the application, but how would I open a specific file, e.g. ANDREW.txt?

    Thanks in advance,

    Andrew

    ------------------
    Andrew Nerney
    Hapless Programmer
    [email protected]

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Try this:

    Call Shell("notepad.exe MyFile.txt", vbNormalFocus)

    ------------------

    Serge

    Senior Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819

  4. #4
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    Post

    Create form with a command button and paste the following code in the click event of the command button:

    'Whatever the Notepad path and file name is

    sNotePadPath = "C:\winnt\notepad.exe "

    'File to open
    sFileName = "andrew.txt"

    x = Shell(sNotePadPath & sFileName, 3)

    Hope that helps.
    JazzBass

    ------------------
    21 yr old beginner VB Programmer
    VB 6 Professional @ Home
    VB 3 Professional @ the Office

  5. #5
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    Post And JazzBass, does your office really use VB3?

    Hey Drew_Dog,
    Thanks for the sympathy.

    Yes, unfortunately I have to use VB3 at the office.
    I guess it's not too bad, but I wish I had VB6 here. Could sure use the database stuff it has.

    Your welcome for the help.
    JazzBass


    By the way, how did you get your "Thanks" post up at the very top of the thread? All recent posts are supposed to go to the bottom, at least that I know of.



    Edited by JazzBass on 02-24-2000 at 02:01 PM

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Post

    I was wondering the same thing, Jazz. SysOp says that there are changes being made to the structure of these boards, so maybe the most recent message displays first now? Or it could be just a bug - this is a VB board and VB is known for its occasional problems

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