Open

Opens a file for writing and sets the file’s encoding. If the file does not exist, Open creates it; if the file exists, Open overwrites it.

Syntax

<HFMwEncodedFileWriter>.Open bstrFileName, lEncoding

Argument

Description

bstrFileName

The name and path of the file to open.

Input argument. String subtype.

lEncoding

The type of encoding to apply to the file. Valid values are represented by the HFMConstants type library constants listed in Extracted File Encoding Constants.

Input argument. Long subtype.

Example

The following function writes the specified text stream to the specified file, with ANSI encoding applied.

Function createFile(sFile, sTxt)
Set cFileWriter = _ 
Server.CreateObject("Hyperion.HFMwEncodedFileWriter")
cFileWriter.Open sFile, EXTRACT_FILE_ENCODING_ANSI
cFileWriter.Write sTxt
cFileWriter.Close
End Function