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.
Printable View
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.
VB Code:
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 Const SW_SHOWNORMAL = 1 Private Sub Form_Load() 'KPD-Team 1998 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] 'Send an E-Mail to the KPD-Team ShellExecute Me.hwnd, "open", "C:\textfile.txt", vbNullString, "C:\", SW_SHOWNORMAL End Sub
Or you could just use Shell:
VB Code:
'New Instance Shell "notepad" 'open a file inside a new notepad Shell "notepad ""C:\testfile.txt"""
Phreak
thanks guys