FileToString

Top  Previous  Next

function FileToString(sFileName As String, ByRef s As String) As Boolean

 

Reads the content of the file sFileName into the string s.

 

If the file doesn't exists or the content couldn't be read, FileToString returns FALSE.

 

Parameters

 

sFileName ... String expression. Absolute path and filename.
s ... String expression.

 

Example:

Dim sFilename, sMem

 

sFilename = "c:\mydocs\template.txt"

If FileToString(sFilename, sMem) Then

   ' sMem contains the file content

End If




Translate document: