How can you use the commondialog control to open a text file into a textbox in your app?
------------------
Printable View
How can you use the commondialog control to open a text file into a textbox in your app?
------------------
Try this:
Code:Dim strPath As String
Dim iFFN As Integer
Dim strBuffer As String
On Error Resume Next
With CommonDialog1
.ShowOpen
If Err.Number = cdlCancel Then Exit Sub
strPath = .FileName
End With
iFFN = FreeFile
Open strPath For Input As iFFN
strBuffer = Space(LOF(iFFN))
strBuffer = Input(LOF(iFFN), #iFFN)
Close #iFFN
Text1.Text = strBuffer
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819