PK: File I/O using vbScript... 
Author Message
 PK: File I/O using vbScript...

Hi,

I am trying to populate a Combobox using Data from an external file. I had
expected to be able to use something like:

Sub Item_Open()
    Dim CBActivity
    Dim inActivity
      Set CBActivity = Item.GetInspector.ModifiedFormPages("P.2").Activity
  Open "DataFile.txt" For Input As #1
        Do While Not EOF(1)
            Input #1, inActivity
            CBActivity.AddItem inActivity
        Loop
  Close #1
     Set CBActivity = Nothing
End Sub

However I now understand that basic file i/o is not available under
VBScript. Is there another way to do this?

Any Help would be much appreciated...

phil kells



Tue, 15 Apr 2003 08:46:37 GMT  
 PK: File I/O using vbScript...


Fri, 19 Jun 1992 00:00:00 GMT  
 PK: File I/O using vbScript...

FileSystemObject User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/jsFSOTutor.htm
VBScript Run-Time Library Reference [FileSystemObject/Dictionary]
http://msdn.microsoft.com/scripting/vbscript/doc/VBSFSOTOC.htm

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Hi,

> I am trying to populate a Combobox using Data from an external file. I had
> expected to be able to use something like:

> Sub Item_Open()
>     Dim CBActivity
>     Dim inActivity
>       Set CBActivity = Item.GetInspector.ModifiedFormPages("P.2").Activity
>   Open "DataFile.txt" For Input As #1
>         Do While Not EOF(1)
>             Input #1, inActivity
>             CBActivity.AddItem inActivity
>         Loop
>   Close #1
>      Set CBActivity = Nothing
> End Sub

> However I now understand that basic file i/o is not available under
> vbscript. Is there another way to do this?

> Any Help would be much appreciated...

> phil kells



Tue, 15 Apr 2003 09:07:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Detect OS in WSH using VBScript

2. Detect OS in WSH using VBscript

3. Remote OS Info on NT using vbscript

4. Diff between Pocket PC OS / Handled PC OS/ Embedded NT OS

5. Converting Postscript fonts to TeX pk files?

6. 2nd try - setting pk constraint using SQL-DMO

7. VB5: convert VB file handle to OS file handle

8. C File Handle and OS File Handle

9. OS file handle versus C file handle

10. Need to extract files from a ZIP file programmatically using VBScript

11. if any files exist then move files using vbscript

12. Detect OS in WSH using VB

 

 
Powered by phpBB® Forum Software