We just printed and signed our corporate holiday cards we are sending out to clients. Of course, we are using TX Text Control's MailMerge capabilities to print the labels for the envelopes.

Printing labels with MS Word compatible templates and data sources

TX Text Control's mail merge functionality is completely compatible to MS Word and you can not only use the Avery address label MS Word templates, but also the Access database files from MS Word.

As a data source, MailMerge supports JSON, structured IEnumerable objects, DataSets or DataTables. Using the new DataSourceManager, you can connect to any data source such ODBC and ADO.NET. If you are using MS Word for mail merge purposes, you typed in customer addresses into the New Address List dialog:

Printing labels with MS Word compatible templates and data sources

This address list is saved as a Microsoft Access Database file (*.mdb or *.accdb).

Using the pre-compiled demo TX Text Control Words - a reference implementation of TX Text Control - you can open this data source. TX Text Control Words uses the ready-to-use RibbonReportingTab class which implements the DataSourceManager that provides the UI workflow and the following dialog boxes. All of them can be used in your own application based on TX Text Control.

  • Select Data Source from the Select Data Source drop-down in the Reporting ribbon tab.

    Printing labels with MS Word compatible templates and data sources
  • Choose Microsoft Access Database File and confirm with OK.

  • In the next dialog page, browse for the database file and confirm with OK.

    Printing labels with MS Word compatible templates and data sources
  • Now find your specific label template and load it into TX Text Control Words.

The Avery label templates use tables to separate the labels:

Printing labels with MS Word compatible templates and data sources

In the next step, you can add the merge fields to the first label.

  • Select Office Address List as your Master Table and insert your required fields using the Insert Merge Field drop-down button:

    Printing labels with MS Word compatible templates and data sources
  • After the last field, insert a Next field from the Insert Special Field drop-down button:

    Printing labels with MS Word compatible templates and data sources
  • Copy the complete content of the first cell into the clipboard and duplicate it by pasting it into all other cells in the table:

    Printing labels with MS Word compatible templates and data sources
  • Click on the Merge into Current Document menu item of the Finish & Merge drop-down button:

    Printing labels with MS Word compatible templates and data sources

The data is merged into the template and you are ready to print the document directly onto your label sheets.