VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Creating a text file

by Bhuwan Chand Joshi (69 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Creating a text file

Rate Creating a text file




Public sub Form_Load()

On error goto Err_Handler

Dim Obj as Object

Dim F1 as Object

Dim varArray as Variant

varArr=Array("Hello","MySelf","Bhuwan")

Set Obj=CreateObject("Scripting.FileSystemObject")

Set F1=Obj.CreateTextFile("Specify the path where you need to create text file like D:\Test.txt")

F1.writeline varArray(0) & " " & varArray(1) & " " & varArray(2)

F1.Close

Err_Handler:

MsgBox Err.Description

End Sub

'This program creates a text file Text.txt in the drive "D:" 


Download this snippet    Add to My Saved Code

Creating a text file Comments

No comments have been posted about Creating a text file. Why not be the first to post a comment about Creating a text file.

Post your comment

Subject:
Message:
0/1000 characters