Create Mailing Labels

[Top]  [Chapter]  [Previous]  [Next]

Now TextDynamic has an exciting new feature. It can display the current document as labels on a label sheet. The label sheet can be configured using the interface LabelDef. You can set the width and height of the sheet, the count of columns and rows, the margins on each side of the sheet and the margin between labels, horizontally and vertically.

 

The properties of the IWPLabelDef interface as graphic:

 

clip0158

Floating point properties such as "SheetHeight" and "SheetWidth" are measured in centimeter, the can be also set as inch if the property UnitIsInch = true.

 

The property "Caption" makes it easy to provide a return address. When this string is not empty 1/2 cm will be reserved on the label for the text and a line will be drawn. You can get a similar effect with standard, repeated text on the label text, but since the caption is not part of the text the user cannot delete it. This makes it easier to edit the created labels in the preview before they are printed. (Yes, you can edit in the "Preview"!)

 

It is also possible to start with a certain label on the first page - in case the label sheet is not empty (StartNr).

 

The property AsText makes it easy to save the label definition as a string together with its name - you can use it to save a set of predefined labels in a simple string list.

 

To display the label sheet you only have to set the property Active = true. This will override the page setup in the editor and the OnMeasurePage event. Since the label definition is part of a "RTFData" element (see demo Simulated MDI)  make sure you change it after a call to RTFDataSelect. You can simply use RTFDataSelect("@@FIRST@@") when you are finished with label printing to return to the mailing template.


[label_printing.htm]    Copyright © 2007 by WPCubed GmbH