Open a notepad file
Could you help me? I want to open a notepad file, after I put some dates into it.
My code is that:
Dim w As Integer
Dim strClients As String
Open App.Path & "/Address email.txt" For Output As #2
For w = 0 To lstEmail.ListCount - 1 Step 1
strClients = lstEmail.List(w) & ";"
Print #2, strClients
Print #2, "==================================================="
Print #2, "Total number of address=", (lstEmail.ListCount - 1)
MsgBox "The addresses was written in " & App.Path & "/Address email.txt", vbInformation,"Email CONTACT"
Here,after msgbox was closed, I want to open the notepad file
If you have some time for help me, please do it...It's a emergency for me.
Thanks in advance and,
I'm just looking for the code - it's the SHELL command you need to use.
Okay, to open notepad you need to know the path of the application. It's most likely to be c:\windows\notepad BUT this MAY change.
So, this code will get you going:
The a becomes the thread ID.
a = Shell("c:\windows\notepad.exe", vbNormalFocus)
As for parsing the file, someone else will know the answer to that one.
Use the ShellExecute API function call:
Originally Posted by z.s
Microsoft MVP (Visual Basic)
Also another way to do this without an API call is to do:
Shell "Notepad.exe NameOfFileHere", VbNormalFocus
Hope that helps
Shell "Notepad.exe C:\Program Files\Test.txt", VbNormalFocus
Last edited by salvinger; 05-04-2005 at 07:26 PM.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL