TX Text Control ActiveX

Mail Merge

Topic

Mail merge inserts the contents of database fields at specified positions of a previously prepared document, the template. With TX Text Control ActiveX, these positions are Marked Text Fields, and a Visual Basic sample program in three parts shows how to fill them from a database, print the merged documents and let users build templates of their own.

Storing a whole document in a database is a different task: Connecting to Databases shows how to save the entire contents of a TXTextControl in one database field.

How the Sample Program Is Organized

Each part of the sample extends the previous one, and each has its own project in the Samples\vb6\MailMerge directory:

  1. Merging Database Data and Text loads a template, browses the records of a database and merges the current record into the Marked Text Fields of the template.
  2. Printing More Than One Record adds a print queue and prints the queued records with a hidden TXTextControl.
  3. Dynamic Template Generation lets the user select a database and insert its fields into the template, and saves the database name with the template.

Find the Right Page

If you want toRead
Fill the fields of a template with a database recordMerging Database Data and Text
Print several records in the backgroundPrinting More Than One Record
Let users insert database fields into a templateDynamic Template Generation
Store a complete document in a database fieldConnecting to Databases
Learn how Marked Text Fields workMarked Text Fields

Pages in This Section