WordPrintDocument (not supported in Axiell Collections)

syntax

result = WordPrintDocument (template, printer, number)

Arguments

template, printer: text

number: numeric

result: integer (error code)

Meaning

Not supported in Axiell Collections and RunAdapl.

Instead of WordCreateDocument (that only exports records to a document, and leaves it to you to actually print the opened document) you can also print or e-mail data from a record directly, using a Word template. For this you use the WordPrintDocument function. Each exported record will be printed on a separate page.

Use the arguments as follows:

template is a text variable or constant with the name of the (custom) Word template that you want to use.
printer is a text variable or constant with the name of the printer to be used for printing. This includes the name of the server on which the printer is installed, twice; see the example below. Use an empty string (two single quotes without a space between them), to direct output to the default printer.
number is a numerical variable or constant used to determine the number of prints you make. If number is 0, zero copies will be printed. You can use the option of printing zero copies, to e-mail the generated Word document instead (as an attachment). In that case, the used Word template must contain relevant e-mail parameters - see the general Adlib User Guide for an explanation of these parameters.
result is 0 when the operation was successful, otherwise an error code results.

Example (for Adlib Library)

WordPrintDocument (‘c:\bibl\wincat\mytemplate’, ‘\\saturnus\HP LaserJet 5Si MX on \\saturnus’, 1)

See also

Accessing data for a Word template from an adapl