aijohn
asked on
Printing a text file in a textbox
Need code that will print a text file in a textbox when a node in treeview is clicked. Also,is listview or textbox more appropriate for this?
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dear aijohn,
th code for putting the entire content of the text file to the text box is:
Private sub GetFile(byval strFile as string)
dim strContents
on error goto ErrHandler
Open strFile For Input As #1
strContents = Input(LOF(1), #1)
Close #1
Text1.text = strcontents
Exit sub
ErrHandler:
msgbox "error occured"
End sub
th code for putting the entire content of the text file to the text box is:
Private sub GetFile(byval strFile as string)
dim strContents
on error goto ErrHandler
Open strFile For Input As #1
strContents = Input(LOF(1), #1)
Close #1
Text1.text = strcontents
Exit sub
ErrHandler:
msgbox "error occured"
End sub
same as above except use
Label1.Caption = String
Hope this is of use