Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > Code Snippets Code Examples

Open a file for writing to

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Open a file for writing to Private Sub Form_Load() Dim objFso As New FileSystemObject Dim objFile As Object Set objFile = objFso.OpenTextFile("f:\Test.txt", ForWriting) objFile.Write "Hello World" objFile.Close End Sub Notes: Make sure you add a reference to the Microsoft Scripting library. Change the file and path to one which you will write to.