![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Reading A Text File Hi I am new to VBScript I work in VBA, I am trying to read a text file held on the C drive we are not working on a server we trying to just add the code into a asp/html file and running it in IE6. We have found that what ever we do we can't get it to work, we are trying to populate a combobox with the contents of the text file can any body please help. This the code we have tried <% Set fs=CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile("C:\Data\Test1.txt, 1) document.Write(f.ReadLine) f.Close Set f=Nothing Set fs=Nothing %> |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Reading A Text File "vqthomf" <vqthomf@xxxxxx> wrote in message news:3CB21BC3-DEAF-4A64-B6CD-0AAB37AD7524@xxxxxx Quote: > Hi I am new to VBScript I work in VBA, I am trying to read a text file > held > on the C drive we are not working on a server we trying to just add the > code > into a asp/html file and running it in IE6. We have found that what ever > we > do we can't get it to work, we are trying to populate a combobox with the > contents of the text file can any body please help. > > This the code we have tried > <% > Set fs=CreateObject("Scripting.FileSystemObject") > > Set f=fs.OpenTextFile("C:\Data\Test1.txt, 1) > document.Write(f.ReadLine) > f.Close > > Set f=Nothing > Set fs=Nothing > %> > more than one ReadLine method. If you want everything at once, try ReadAll. For more info, see: http://www.devguru.com/technologies/VBScript/14118.asp |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Reading A Text File Well after trying all day yesterday it actually works thanks for the help much appreciated. "vqthomf" wrote: Quote: > Hi I am new to VBScript I work in VBA, I am trying to read a text file held > on the C drive we are not working on a server we trying to just add the code > into a asp/html file and running it in IE6. We have found that what ever we > do we can't get it to work, we are trying to populate a combobox with the > contents of the text file can any body please help. > > This the code we have tried > <% > Set fs=CreateObject("Scripting.FileSystemObject") > > Set f=fs.OpenTextFile("C:\Data\Test1.txt, 1) > document.Write(f.ReadLine) > f.Close > > Set f=Nothing > Set fs=Nothing > %> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Reading text file at a URL | VB Script | |||
| Reading file names and Searching for text | VB Script | |||
| Reading a text file with StreamReader | .NET General | |||
| Refresh on Reading more than one variable from a Text file | VB Script | |||
| Reading text file and charting them via powergadget | PowerShell | |||