Im trying to pull a random line from a text file and store it into a variable.
I found this piece of code on the web which looks good but I cant seem to get it working in vs 2010, any ideas ?
Dim MyString As String
Dim MyBuffer() As Byte
Open "C:\AFile.txt" For Binary Access Read As #1
ReDim MyBuffer(LOF(1) - 1)
Get 1, , MyBuffer
MyString = StrConv(MyBuffer, vbUnicode)
ReDim MyBuffer(0) 'Free up memory
Many thanks in advance.
View Complete Post