Offline TX Forum Archive Now Available
If you have been following the newsletters from the last two weeks, you will know that we announced that we would be preparing an offline version of the TX Text Control Forum. We asked you which format you would prefer and you answered that a flat file would be the best implementation of such an archive. If you missed out, then see the following two articles:
- TX Discussion Forum - Do You Want An Offline Archive?
- Response To Offline TX Discussion Forum Idea.
We have now completed the conversion process - we used TX Text Control to produce the final file, but that is another story.
The resulting archive - one long HTML file - is around 830 KB when decompressed. However, to speed up the downloading process we have zipped the file. The zip file is 260 KB in size and can be downloaded from:
--- no longer available ---
The file uses HTML to apply very simple formatting to improve readability. The subjects of the messages, for example, have been made bold. Next week, we will release an updated version of the archive, which makes better use of hyperlinks. Be sure not to miss it next Wednesday.
I hope that you enjoy the offline TX Discussion Forum - I am looking forward to hearing your comments on it.
Top TX Tip: Meik's Mail Merging - The Professional Way (Part #2)
This week we are going to continue where we left off last week. Should you have missed part one of this tutorial, you can read more.
As you remember from last week, we were in the process of creating a mail merge application using TX Text Control - we have already built in the basic features such as pulling data from a database and inserting it into our TX document. This week, we are going to add the ability to print our mail merged document to a local printer.
Now, I guess some of you are screaming: "BFD - that's a piece of cake. I mean, I can grab the code from other examples and use that, right?" So that we do not bore you with this (what would seem) trivial task, we are going to build in a few advanced features, to make the example a little more complicated.
We are going to set up a print queue. With the example from last week, the user can browse through a database and merge single data records in to his or her document. The user will have the option to add single records to the print queue and then start the printing of the queue on command.
The queue is a simple list box, in which the company name of the current record is added. This record name will then be replaced by the actual data from the current record.
To print a document in the background - i.e. so that the user does not know it is being printed - we have to use a cunning trick: We use a second, invisible TX Text Control, which we fill with the data from the first and only then do we print it.
So that we do not have to write a second routing for the merging, the old one has been changed a little and defined globally. This globally defined routine now gets the parameters from the TX Text Control in which the merging is currently taking place. What's more the actual records from the database are now merged in the marked text fields and no longer the label captions.
Now we just need to call StartPrinting to start the printing! Take a look at the following VB code:
Dim data() As Byte
Dim i As Integer
' Copy document to hidden TX
data = Form1.TXTextControl1.SaveToMemory(3, False)
Form2.TXHidden.LoadFromMemory data, 3, False
' Print queue
While (doPrint And Form2.List1.ListCount > 0)
Merge Form2.TXHidden, Form2.List1.List(0) ' Merge data
For i = 1 To Form2.TXHidden.CurrentPages
Form2.TXHidden.PrintDevice = Printer.hDC
RemoveItem (0) ' First item printed, remove it from queue
As you can see the complete content of the visible document is copied into the second, hidden TX Text Control. We use LoadFromMemory and SaveToMemory to do this. Now we simply have to work off the queue:
A simple while loop, which runs until there are no longer entries in the list box, takes care of this.
However first, we have to do the actual merging. The hidden TX and the string at position 0 of the list box are passed as parameters. In this case it is the company name of the record which is to be printed. The document is then printed and finally the record is removed from the list box.
Next week we shall complete this little tutorial, by creating a template generator for a sample database.
If anything is not clear in this example, simply send us an e-mail.
Free Advertising For Your TX Text Control Application
For you long-time TX users, I guess you are getting fed up of reading about this, but as there are more than 1200 new TX Text Control Newsletters readers per month, I do have to repeat this about once a month. Please do not despair!
So, to all you new to TX Text Control: We would like to give you the opportunity of free advertising for your TX Text Control based product on our web site.
All we ask is that you send us your text, as well as a few screenshots detailing how you used TX Text Control in your software application and within about two days of receiving this material, we will add your story, along with your logo and your name to our sample application pages.
So far we have had a terrific response to our request for sample TX Text Control applications from the hard core TX users, but I am know there are thousands of other TX based applications out there - all of which should be added to the sample application page. Just send me a short text, explaining how you used TX Text Control to implement your application and you get free advertising for this product on our web site. I'm looking forward to receiving your material!
Site of the Week
Take a look at the first of this weeks' featured sites: The "Visual Basic Resource" has a large number of downloadable source code, projects, ActiveX and tutorials. They even offer a competition, where you can win a copy of the soon to-be-released CESWare KlikType ActiveX Control. While you are there, why not sign up for their newsletter, which is packed with VB gossip, tips and tricks:
The Newsletter Team