Sub FileToString($fileName As String, ByRef $s As String) As Boolean


Reads the contents of the file specified by $fileName into the string $s.


If the file does not exist, or if the contents cannot be read, FileToString returns FALSE.


Parameters


  • $fileName ... String expression that specifies the absolute path and file name.
  • $s ... String expression that receives the file contents.


Example:

Dim $sFilename, $sMem

$sFilename = "c:\mydocs\template.txt"
If FileToString($sFilename, $sMem) Then
   ' sMem contains the file content
End If