Cicode Programming Reference > Cicode Function Categories > File Functions Introduction > FileRichTextPrint

FileRichTextPrint

Prints the rich text file sFilename to the printer given by sPortname.

Syntax

FileRichTextPrint(sFilename, sPortName)

sFilename:

The filename of the rich text format file. The filename needs to be entered in quotation marks "".

Remember that the filename for a saved report comes from the File Name field in the Devices form. The location of the saved file needs to also be included as part of the filename. For example, if the filename in the Devices form listed [Data];RepDev.rtf, then you would need to enter "[Data]\repdev.rtf" as your argument. Alternatively, you can manually enter the path, for example, "c:\MyApplication\data\repdev.rtf".

If you are keeping a number of history files for the report, instead of using the extension rtf, you need to change it to reflect the number of the desired history file, for example, 001.

PortName:

The name of the printer port to which the rich text file will be printed. This name needs to be enclosed within quotation marks "". For example "LPT1", to print to the local printer, or "\\Pserver\canon1" using UNC to print to a network printer.

Return Values

0 if successful, otherwise an error is returned.

Related Functions

PageRichTextFile, DspRichTextPrint

Example

// This would print the file [Data]\richtext.rtf to LPT1. Remember
that the [Data] path is specified in the Citect.ini file. The file
richtext.rtf is the name of the output file for the report, as
specified in the Devices form. //
iResult = FileRichTextPrint("[Data]\richtext.rtf","LPT1:");
// This would print the file f:\citect\data\richtext.rtf to LPT1.
The file richtext.rtf is the name of the output file for the
report, as specified in the Devices form. //
iResult = FileRichTextPrint("f:\citect\data\richtext.rtf","LPT1:");

See Also

File Functions