-
Open a notepad file
Hi,
Could you help me? I want to open a notepad file, after I put some dates into it.
My code is that:
==========================
Sub Fill_list()
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
Next w
Print #2, "==================================================="
Print #2, "Total number of address=", (lstEmail.ListCount - 1)
Close #2
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
End Sub
====================================
If you have some time for help me, please do it...It's a emergency for me.
Thanks in advance and,
Best regards
Zane
zane
-
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:
Code:
a = Shell("c:\windows\notepad.exe", vbNormalFocus)
Debug.Print a
The a becomes the thread ID.
-
As for parsing the file, someone else will know the answer to that one.
-
 Originally Posted by z.s
Hi,
Could you help me? I want to open a notepad file, after I put some dates into it.
Use the ShellExecute API function call:
http://vbnet.mvps.org/code/shell/shellexecute.htm
Paul
~~~~
Microsoft MVP (Visual Basic)
-
Other Solution
Also another way to do this without an API call is to do:
Code:
Shell "Notepad.exe NameOfFileHere", VbNormalFocus
example:
Code:
Shell "Notepad.exe C:\Program Files\Test.txt", VbNormalFocus
Hope that helps
Last edited by salvinger; 05-04-2005 at 07:26 PM.
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
|
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
|
Bookmarks