ToolsCreateLabels

Syntax

ToolsCreateLabels [.ExtractAddress = number] [, .LabelListIndex = number] [, .LabelIndex = number] [, .LabelDotMatrix = number] [, .LabelTray = number] [, .LabelAcross = number] [, .LabelDown = number] [, .SingleLabel = number] [, .LabelRow = number] [, .LabelColumn = number] [, .LabelAutoText = text] [, .LabelText = text] [, .PrintEnvLabel] [, .AddToDocument] [, .LabelTopMargin = number or text] [, .LabelSideMargin = number or text] [, .LabelVertPitch = number or text] [, .LabelHorPitch = number or text] [, .LabelHeight = number or text] [, .LabelWidth = number or text]

Remarks

Creates a label or a sheet of labels that is printed with the active document. The arguments for the ToolsCreateLabels statement correspond to the options on the Labels tab in the Envelopes And Labels dialog box (Tools menu).

Argument

Explanation

.ExtractAddress

Specifies whether or not to use the text marked by the "EnvelopeAddress" bookmark (a user-defined bookmark) as the label text:

0 (zero) The "EnvelopeAddress" bookmark is not used.

1 The "EnvelopeAddress" bookmark is used.

.LabelListIndex

For dot matrix printers, the values are:

1 Avery® Standard

3 Avery Intl (UK)

4 Avery Intl (France)

6 CoStar LabelWriter

For laser printers, the values are:

0 (zero) Avery Standard

2 Avery Pan European

5 Other

.LabelIndex

Corresponds to an item in the Product Number box in the Label Options dialog box: 0 (zero) corresponds to the first item, 1 to the second item, and so on.

.LabelDotMatrix

Specifies the kind of printer:

0 (zero) Laser

1 Dot matrix

.LabelTray

Corresponds to a tray listed in the Tray list box in the Label Options dialog box: 0 (zero) corresponds to the first tray in the list, 1 to the second, and so on. Available only if .LabelDotMatrix is set to 0 (zero).


Argument

Explanation

.SingleLabel

If 1, allows you to print a single label on a page of labels by specifying .LabelRow and .LabelColumn.

.LabelRow

If .SingleLabel is set to 1, the row containing the label you want to print.

.LabelColumn

If .SingleLabel is set to 1, the column containing the label you want to print.

.LabelAutoText

The name of an AutoText entry in which the label text is stored (ignored if .ExtractAddress is specified).

.LabelText

The text to print on the labels (ignored if .ExtractAddress or .LabelAutoText is specified).

.PrintEnvLabel

Prints the labels.

.AddToDocument

Creates a new document with label text ready for printing.


The following arguments are for creating custom labels and need not be specified (and are ignored) if the combination of .LabelListIndex, .LabelIndex, and .LabelDotMatrix specifies valid labels.

Argument

Explanation

.LabelAcross

The number of labels in a row

.LabelDown

The number of labels in a column

.LabelTopMargin

The width of the top margin on the page of labels, in the current default unit or a text measurement

.LabelSideMargin

The width of the side margins on the page of labels, in the current default unit or a text measurement

.LabelVertPitch

The distance from the top of one label to the top of the next label down, in the current default unit or a text measurement

.LabelHorPitch

The distance from the left edge of one label to the left edge of the next label across, in the current default unit or a text measurement

.LabelHeight

The height of the labels, in the current default unit or a text measurement.

.LabelWidth

The width of the labels, in the current default unit or a text measurement.


Example

This example creates a new document with label text arranged for printing onto a sheet of Avery labels. The argument .LabelListIndex = 0 specifies Avery Standard as the label product, and .LabelIndex = 4 specifies product number 5160 (for addresses). The label text is retrieved from the AutoText entry "MyLabelAddress."


ToolsCreateLabels .LabelListIndex = 0, .LabelIndex = 10, \
    .LabelDotMatrix = 0, .LabelTray = 1, .AddToDocument, \
    .LabelAutoText = "MyLabelAddress"

See Also

ToolsCreateEnvelope