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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

control that will open a text file in the default text editor

Status
Not open for further replies.

shilpashetty27

Technical User
Apr 12, 2007
32
CA
Hi all,

I need some pointers on file handling in Borland.

I’m trying to create a button that will open a file in my default text editor. Not sure if there is a BCB function that can handle this.

The file to be opened is created using the OpenDialog control.


Thanks in advance for your help!
Cheers,
Shilpa
 
See if faq101-1952, faq101-1953, or faq101-1954 will help.



James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
ShellExecute(handle, "open", "filename.txt", NULL, NULL, SW_SHOWNORMAL);

this will open a file with it's associated program.
Since you will use a Opendialog to open the file you have to replace "filename.txt" to OpenDialog1.filename :)
You can also replace SW_SHOWNORMAL with many other SW_, just google :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top