Pastetool - OpenTextFile

URL: , Paste another

Function OpenTextFile(FileName As String) As String
    If FileName = "" Then Exit Function
    
    Dim f As Integer
    Dim lR As String
    Dim RetVal As String
    
    f = FreeFile
    On Error GoTo ErrHandler
    Open FileName For Input As f
        
        'Optimized version
        RetVal = Input(LOF(f), #f)
        
'        While Not EOF(f)
'            Line Input #f, LR
'            RetVal = RetVal & LR & vbNewLine
'        Wend
    Close f
    OpenTextFile = RetVal
ErrHandler:
End Function

Download code

This visual basic code was pasted on September 8, 2009




Protected with advance Anti-SPAM techniques :)
Coded and designed by Fedmich
Follow us on Twitter