DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Method: CreateTextFile for Folder

Method: CreateTextFile for Folder

Creates a file in a folder and returns the associated TextStream object.

Set oTextStream = Object.CreateTextFile(FileName, [Overwrite], [Unicode])
ObjectFolder
Object with this method
FileNameString
Specifies the filename.
[Overwrite]Boolean
Specifies whether DIAdem overwrites an existing file. If the value is True, DIAdem overwrites an existing file. If the value is False, DIAdem does not overwrite an existing file. The default value is False.
[Unicode]Boolean
Specifies whether DIAdem creates a Unicode or an ASCII file. If the value is True, DIAdem creates a Unicode file. If the value is False, DIAdem creates an ASCII file. The default value is False.
oTextStreamTextStream
Returned object

The following example creates a text file, writes a text into this file, and then closes the file:

Sub CreateMyTxtFile(sFolder,sFile,sText)
  Dim fso, oMyFolder, oMyFile
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyFolder = fso.GetFolder(sFolder)
  Set oMyFile = oMyFolder.CreateTextFile(sFile, True)
  Call oMyFile.WriteLine(sText)
  Call oMyFile.Close
End Sub

See Also

Objects Overview

In This Section
Was this information helpful?