Use the TextStream object to write to a text file. The TextStream object is obtained using one of the following methods.