This message contains graphics. If you do not see the graphics: Graphic Version.
 
Professional Mail Merging, Write-Up in Delphi Newsletter

Response to offline TX Discussion Forum idea

May we firstly thank all of you who wrote me in response to the "TX Discussion Forum - Do You Want An Offline Archive?" article from last week's newsletter. We were delighted by the positive response. It seems that many people would indeed like a possibility to search past editions of the TX Text Control Discussion Forum on their local hard disk.

Last week we gave you three suggestions as to how we should enable this off line searching. In brief they were.

  1. to place a pure text file of all the past messages on our web server;
  2. to give you the opportunity to download the past messages in the form of a MS Access database;
  3. to give you the raw SQL data from our MySQL database (the backend to the TX Discussion Forum).

Not surprisingly, not many people wanted to take me up on the last option. This is a shame, as this would certainly have been the most flexible solution, as you could have replicated the TX Forum exactly as it is on your local LINUX server. However, I guess that not every one has a LINUX server sitting in their office (nor at home! :-) ).

A few people mentioned their preference for a MS Access file. A majority of you, however, insisted that it should not be a prerequisite to have MS Access installed to read the past messages from the TX Forum.

By far the most popular response was to make the data from the TX Discussion Forum available in a pure text file, which we simply update once per month (or more often if you like - again just write me).

Some people even told me not to bother with an off line archive of the TX Forum, as they find the online version more than sufficient. Naturally, our customers in Europe - where internet access is NOT (yet) charged at a flat rate - would not find this solution particularly attractive.

So, at the request of our TX users, we will dump the TX Forum to a single text file and remove all sensitive data from the ASCII file. See last week's newsletter for a discussion on why the removal of all sensitive data is necessary if you missed it at.

Top TX Tip: Meik's Mail Merging - The Professional Way

Over the next few weeks, we are going to be looking at Mail Merge. If you do not know what Mail Merge is, we recommend that you take a look at the TX Text Control feature list description of how TX Text Control implements Mail Merge.

If you are a hardened hacker, then you no doubt will already know all about Mail Merge and how to implement it in TX - thus this example will be somewhat superfluous. However, we still get a lot of support questions concerning mail merging, so we thought it is about time that we created a set of tutorials describing how to create a complete mail merge application from scratch, using TX Text Control. This is part one of the step-by-step guide.

First of all, we are going to start with an example that illustrates just about the same thing as the Stdlet example from the TX Text Control sample application, shipped with TX.

In this example you will find a menu point, with which a template file can be loaded. This file already contains a bunch of Marked Text Fields. So that we can get some data from a database into these fields, each one has a unique name. These unique names are saved in the FieldData property.

Using a second menu point, a further form can be opened - this allows a suitably prepared database to be linked. With a Buttonclick, the current data set can be merged into the document.

The most important function of this example is the one which allows a data field from the linked database to be merged into a field from TX Text Control. Using the Stdlet example as it is, this is not possible. To get this to work, we need to get the field number of the Market Text Field which belongs to the data field. This can be simply achieved using the following code:

Function FindField(name As String) As Integer Dim id As Integer Dim foundID As Integer foundID = 0 id = Form1.TXTextControl1.FieldNext(0, 0) While id <> 0 If Form1.TXTextControl1.FieldData(id) = name Then foundID = id End If id = Form1.TXTextControl1.FieldNext(id, 0) Wend If foundID <> 0 Then FindField = foundID Else FindField = 0 End If End Function

Using a loop we simply go through all the fields from TX - and the FieldData property belonging to each field - to check whether it is the same as the name we are searching for. If we get a hit, its' ID is returned. If no field is found, then a zero is returned.

Download our runnable sample program.

At the moment this is for Visual Basic only, but next week, we will be getting a Delphi sample to you as well.

Also next week we will have a look at how we can take this really simple example to the next stage: we'll be building in a few cool features, like printing auto-populating documents. To give you some idea of what can be really done with this example, take a look at our own merge application. Given a few hours, you too will be creating applications like this in no time.

Learn Delphi the easy way!

Most so-called programming lessons for beginners start with the words "We assume that you have a full knowledge of..."

The DelphiLand tutorial is different, it really starts from the bottom line. Read the first Delphi lessons online. If you are convinced of the quality of the tutorials, sign up for a membership of the "DClub". DelphiLand is continuously improved and more tutorials are added, based on the member's comments and feedback. Members receive all of the lessons and their fully commented source code files.

The DelphiLand Tutorials and all of the associated projects are available for FREE until May 31, 2000. To find out more, surf to:

http://www.festra.com


Best regards

The Newsletter Team

Text Control GmbH respects your online time and privacy. We only send this newsletter to TX Text Control customers and people who have signed up to receive it. However, if you would prefer not to receive future issues of the newsletter, you may unsubscribe at any time. If you received this newsletter forwarded from a colleague or friend, you may wish to subscribe directly.

Sent to: N/A.

Imprint | Unsubscribe | Subscribe

© 2000 Text Control GmbH. All Rights Reserved.