Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleOpen a text file in the system's default text editor
DescriptionThis example shows how to open a text file in the system's default text editor in Visual Basic 6.
Keywordseditor, default editor, system editor, text file
CategoriesAPI, 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated