How to Write Double Quotes to File in VB Script
A very useful feature of the Visual Basic language is the ability to create new text files that houses information such as reminders or even error messages. Sometimes you may want to put certain punctuation marks in your text, such as a double quote, which can be hard to accomplish as Visual Basic views double quotes as a special character that it doesn't normally display.
Instructions
-
-
1
Open Visual Basic from your desktop icon or by accessing it through the "Start" bar and then clicking on "Programs."
-
2
Create a new project or open an existing project you were already working on.
-
-
3
Write out the code you need to create a new text file by using the "Create Object" function and "CreateTextFile" command.
-
4
Use the "WriteLine" object to specify what you want to appear in the file.
-
5
Place an extra set of double quotes around the text that you want to have double quotes around it. For example, if you wanted to write the line "This Information Is Important" you would instead write ""This Information Is Important.""
-
1
Tips & Warnings
Be sure to place a comment line before your text stating why you are using two sets of double quotes together or another coder who later works with the project may think they are incorrectly placed and remove them.
Resources
- Photo Credit Microsoft
Comments
-
' Huanton !
Oct 26, 2008
Great stuff here. Very interesting!