Results 1 to 3 of 3

Thread: opening a file in notepad - newbie question

  1. #1
    new user
    Guest

    opening a file in notepad - newbie question

    how do i make it so when i click a button, a file like 'c:\file.txt' is opened in notepad.
    thaks!

  2. #2

    opening a file in notepad - newbie question

    add shellapi to your usses clause

    then in the buttonclick event add this line:
    ShellExecute(0, 'open', 'notepad.exe', 'c:\file.txt','', SW_SHOWNORMAL);

    that should be it!
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    opening a file in notepad - newbie question

    A better option is to just execute the text file. This will use the registered text editing application to open the file. Much nicer to the end user like me who uses UltraEdit for all text editing purposes.

    ShellExecute(0, 'open', 'c:\file.txt', nil, nil, SW_SHOWNORMAL);

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •