View Single Post
  #11  
Old 01-06-2005, 08:06 PM
Don Wiss
Guest
 
Posts: n/a
Re: Getting text file into a VBA string variable

On Thu, 6 Jan 2005 08:51:55 -0500, Tom Ogilvy <twogilvy@msn.com> wrote:

>Function OpenTextFileToString2(ByVal strFile As String) As String
> ' RB Smissaert - Author
> Dim hFile As Long
> hFile = FreeFile
> Open strFile For Input As #hFile
> OpenTextFileToString2 = Input$(LOF(hFile), hFile)
> Close #hFile
>End Function


Works like a charm. Nice and simple. I can feed the output of this function
directly into a user form textbox.

Thanks, Don <donwiss at panix.com>.
Reply With Quote