WriteAllText

The Archn00b

Registered User.
Local time
Today, 14:43
Joined
Jun 26, 2013
Messages
76
I'm trying to use the WriteAllText method to write a text file based on some values in my database.

Code:
' Declaring Header
Dim Header As String
Header = "Line 1" & _
"Line 2" & _
"Line 3"
' Writing Text to file
My.Computer.FileSystem.WriteAllText("[Pathway]", Header, True)
End Sub

The debugger says there is a syntax error in:

Code:
My.Computer.FileSystem.WriteAllText("[Pathway]", Header, True)

It expects an = somewhere apparently.

Any ideas? Thanks!
 
What is My? Please show all your code.
Do you have a reference to the Scripting Runtime?

See this guide for set up and examples.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom