'Display the first line Debug.Print "First Line:" objStream.Position = 0 strLine = objStream.ReadText(adReadLine) Debug.Print strLine Debug.Print "Line length: " + str(Len(strLine))
'Skip a line, then display another line Debug.Print "Third Line:" objStream.SkipLine strLine = objStream.ReadText(adReadLine) Debug.Print strLine Debug.Print "Line length: " + str(Len(strLine))
'Switch line separator to carriage return 'All items from list will be considered one line 'Assuming no CRs have been loaded into stream Debug.Print "Whole Stream/First Line:" objStream.Position = 0 objStream.LineSeparator = adCR strLine = objStream.ReadText(adReadLine) Debug.Print strLine Debug.Print "Line length: " + str(Len(strLine)) Debug.Print "Stream size: " + str(objStream.Size)
'Use EOS to Determine End of Stream Debug.Print "Character by character:" objStream.Position = 0 Do Until objStream.EOS strChar = objStream.ReadText(1) Debug.Print strChar Loop End Sub