Write

<< Click to Display Table of Contents >>

 

Write

Write(Value)

Sends the String passed on the Value parameter to the printer selected on the Line Printer object. If the value passed by this method exceeds the number of pending lines configured in the MaxPendingLines property, this method returns an error and the String is discarded.

The Value parameter is sent to the configured printer as raw data, that is, without any type of formatting. To print special characters, such as new lines or tabs, use String constants or VBScript's Chr method, which receives the ANSI code of the character to print. The next table contains the most common constants for printing to dot-matrix printers. For more information about specific characters, please check the user's manual of the printer to use.

Most common constants for printing special characters

Constant

Value

Description

vbCr

Chr(13)

Carriage-return character

vbLf

Chr(10)

Linefeed character

vbCrLf

Chr(13) & Chr(10)

Carriage-return and linefeed characters

vbNewLine

Chr(13) & Chr(10) ou Chr(10)

Carriage-return and linefeed characters or only linefeed character, depending on the printer used

vbTab

Chr(9)

Tab character

Was this page useful?