Skip to content

Instantly share code, notes, and snippets.

@jesse1981
Created May 8, 2013 00:07
Show Gist options
  • Select an option

  • Save jesse1981/5537210 to your computer and use it in GitHub Desktop.

Select an option

Save jesse1981/5537210 to your computer and use it in GitHub Desktop.
Get file contents to variable.
function includeFile (fSpec)
On Error Resume Next
dim fileSys, file, fileData
set fileSys = createObject ("Scripting.FileSystemObject")
set file = fileSys.openTextFile (fSpec,ForReading)
fileData = file.readAll ()
file.close
set file = nothing
set fileSys = nothing
includeFile = fileData
end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment