
04-06-2003, 09:40 PM
|
|
Contributor
|
|
Join Date: Dec 2002
Posts: 542
|
|
Code:
Public bytFileArray() As Byte
Sub OpenFile(strfileName As String)
Dim lngFileNumber As Long
lngFileNumber = FreeFile
Dim lngFileLength As Long
lngFileLength = FileLen(strfileName)
ReDim bytFileArray(lngFileLength) As Byte
Open strfileName For Binary As lngFileNumber
Get lngFileNumber, , bytFileArray
Close lngFileNumber
End Sub
If you know that the file is a text file, then you can read it into an appropriately dimensioned string instead. 
|
|