PDA

Click to See Complete Forum and Search --> : Commondialog


MPrestonf12
Nov 10th, 1999, 10:30 PM
How can you use the commondialog control to open a text file into a textbox in your app?


------------------

Serge
Nov 10th, 1999, 10:40 PM
Try this:



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
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)