|
|
Title | Open a text file in the system's default text editor |
Description | This example shows how to open a text file in the system's default text editor in Visual Basic 6. |
Keywords | editor, default editor, system editor, text file |
Categories | API, Files and Directories, Windows |
|
|
The program uses the ShellExecute API function to "open" the text file. The system looks up the default editor for that kind of file and opens the file with it. (This example assumes that the text box txtFile contains the name of a .txt file.)
|
|
Private Sub cmdOpen_Click()
ShellExecute Me.hwnd, "open", txtFile.Text, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub
|
|
|
|
|
|