|
-
Aug 2nd, 2004, 01:26 AM
#1
Thread Starter
New Member
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.
-
Aug 2nd, 2004, 01:31 AM
#2
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]
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, "open", "C:\textfile.txt", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Has someone helped you? Then you can Rate their helpful post. 
-
Aug 2nd, 2004, 03:36 AM
#3
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
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Aug 2nd, 2004, 04:15 PM
#4
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|