Have you ever received a newsletter with your name and address printed on the back? If you have ever wondered what it takes to do that for your organization or business, you are in the right place. With a little bit of VisualBasic programming and the right equipment, you can save a ton of time and effort.
Several months ago, a co-worker was trying to print a company newsletter on a large Toshiba printer that folds, prints, staples, and possibly makes coffee (it is a very nice machine). His problem was that every time he did a mail merge to get the names and addresses populated on the newsletter back page, the printer would print all of the several hundred newsletters and try to staple and fold the whole group. The Toshiba is a nice machine but there was no way it could print over 1000 pages, fold and staple them. The first 2 or 3 would print, get stapled together, and an error would occur.
Through the magic of VisualBasic programming and macros, we were able to get the desired result. Here is the code it took to print each one separately:
https://gist.github.com/7404214
You can also see this code on GitHub. Here is a rundown of the function:
- Lines 6-8 declare the variables
- Line 10 sets up the variable to control the loop
- Line 11 makes sure the mail merge starts at the beginning
- Lines 13-30 is the loop that steps through the mail merge records
- Lines 15-17 sets up the file name if you are going to save the files (not necessary if you are only going to print)
- Line 20 saves the files if needed
- Line 26 prints the document
- and Line 28 moves to the next mail merge record
In your situation, you may need to adjust a few lines of code but if your mail merge is setup right, it should work.
If you have a chance to use this macro, leave me a comment and let me know how it works for you.
Leave a Reply
You must be logged in to post a comment.