Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do u open a Text Document in Notepad from VB?

Status
Not open for further replies.

Brawn

Programmer
Jul 5, 2001
73
0
0
CA
How do u open a Text Document in Notepad from VB?
Without using an OLE object, just program code.

[morning] Brawn

"My mind is my Shrine,
and my body the Temple around it."

-The difference between genius and stupidity is that genius has its limits-
 
Code:
dim textfile As String
textfile = "Path to your text file"


Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad " & textfile
 
Use Rich Text Box and Common Dialog Box from Component

Private Sub Command1_Click()
CommonDialog1.ShowOpen
RichTextBox1.FileName = CommonDialog1.FileName
End Sub

This code will load the text file in richtext box


your
dass


 
Thanks,
[smile]
Brawn

"My mind is my Shrine,
and my body the Temple around it."

-The difference between genius and stupidity is that genius has its limits-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top