Results 1 to 4 of 4

Thread: open notepad file

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    open notepad file

    how do you make Visual Basic open a notepad file?

    I need it to open new notepad file every time the command button is clicked.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    2. Const SW_SHOWNORMAL = 1
    3. Private Sub Form_Load()
    4.     'KPD-Team 1998
    5.     'URL: [url]http://www.allapi.net/[/url]
    6.     'E-Mail: [email][email protected][/email]
    7.     'Send an E-Mail to the KPD-Team
    8.     ShellExecute Me.hwnd, "open", "C:\textfile.txt", vbNullString, "C:\", SW_SHOWNORMAL
    9. End Sub


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Or you could just use Shell:
    VB Code:
    1. 'New Instance
    2. Shell "notepad"
    3. 'open a file inside a new notepad
    4. Shell "notepad ""C:\testfile.txt"""

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    worked

    thanks guys

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