DirectTextPrinter Reference

 

DirectTextPrinter allows you to perform a stateless print job.

Advanced: Besides being stateless and simple it is also a MTS object. This allows you to make it part of a transaction. When printing fails, your transaction will be rolled back.

Object syntax

Name Declaration
PrintDirect Sub PrintDirect(Text As String, [Timeout], [Port], [Codepage])

HRESULT PrintDirect([in] BSTR Text, [optional, in] VARIANT Timeout, [optional, in] VARIANT Port, [optional, in] VARIANT Codepage);

Description:

Print text to a printer.

Method Parameters:
  • Text - The text to print.

  • Timeout (optional) - How long to wait (in milliseconds) if the printer doesn't respond.

  • Port (optional) - The port that the printer is connected to. See ports page for explanation.

  • Codepage (optional) - The codepage that the printer is expecting to receive. See codepages page for explanation.

Errors:

E_INVALIDARG - On negative codepage or timeout.
See list of printing errors.


Copyright 2004 CodeBuildingBlocks