Purpose
To create visitors passes / name tags with QR-codes for festivals and events
Setup
Each QR-code contains the basic data on a person. It can simply be their names and e-mail addresses but can be extended to cover a complete business card including telephone numbers, faxes, hyperlinks and business address.
Uses
- Identify people: when you want to mail a person back, send information, involve them in a game
- Connecting people: exchange e-mail addresses and personal data (name, telephone number)
Creating the mail merge using Word
Basis
The mail merge will include these elements:
- Clear text: the name, e-mail and anything you want to put on the name tag / visitor pass
- A hyperlink to an image on the web: the QR-code as generated by the Google maps API
The result will be a name tag / visitor pass with:
- The name and other info in clear text
- A QR code including any data you wish, like name, e-mail and telephone number
Example:
TABLE OF CONTENTS:
- Before you start – stuff that is important to know regarding Word, images and mail merge
- The trick: IncludePicture tag – describes how to insert and use the IncludePicture tag
- Linking the data source – describes how you link the data source to the word document
- Creating the tags in the document – brief reference to creating the other taqgs
- Mail merge: the different results and view – showing you the different views Word – including ersatz images – can present you after the mail merge. Includes the tip how to load the actual images.
- QR-codes from Google Maps – tells you how the QR-codes work and how to get them in the right scale
- Generating the personalized QR-code links in Excel – as we use Excel as the source of the addresses, this describes how to create the link to Google Maps
- Getting the size right – describes how to set use the DPI settings for Web content to manipulate the size of the QR code
- Conclusion – things to know
1: BEFORE YOU START: IMPORTANT TO KNOW
Word does not automatically load the images when you create a mail merge. When Word creates the mail merge, it will not automatically load the image. This is a known problem. The solution is this:
- Create the Mail Merge: using the option “Edit individual documents”
- Press <control> A: Selects all / selects entire document
- Press F9: refreshes the content in the merged document. The images will be retrieved from their web-location. This can take a while depending on your internec connection and the number of images to be retrieved.
Moving an IncludePicture tag with embedded “mergefield” tag
For some reason, Word converts the tag into an image which loses the data-binding options when you move the tag around. So:
- Determine where the image will be
- Place the IncludePicture tag
Or use copy/paste
2: The trick: INCLUDEPICTURE tag
Word allows you to include pictures in your mail merge using the INCLUDEPICTURE tag. There is a catch with this tag: to make it work with dynamic image links, you need to embed the {MERGEFIELD “<fieldname>”} tag inside the INCLUDEPICTURE tag.
There are several ways to do this. The simplest is this:
- Press <control> F9: an empty mail merge field tag will be created
- Right click on the created tag: the context menu will appear
- Click on the option “Edit field”: a popup will appear in which you can select the type: “IncludePicture”
- Select “IncludePicture” from the list: the tag will be created
- Click on the IncludePicture tag and add quotes: “” : this will contain the hyperlink to the QR-code. It will look like this (cursor is between the quotes):
- Place the cursor within the quotes and click on “Insert merge field”: this will insert the tag of the QR code
Result:
4: CREATING THE TAGS IN THE DOCUMENT
There are several ways to create the Mail Merge fields in Word. The simplest is to use the “Insert Merge Field” box as shown in step 6 regarding the IncludePicture tag.
5: MAIL MERGE: DIFFERENT VIEWS AND RESULTS
Below I present the different results Word can and will show you.
- When the document is loaded in Word. Tags show with French quotes. The image is an erzats image.
As I already run the merge with the following steps, a QR-code is shown. This is not the one that will be the end result - Pressing <ALT> F9 will switch to the “edit” modus and reveal the coding of each tag:
- When you perform the mail merge in the tab “Mailings” using:
This will possibly be the result:
- Hit <ALT> F9 if so. You wil be presented with a ersatz image:
In this case, the image is one loaded in a previous session. Very likely it will be an empty box. - Hit <CTRL> A to select the entire document
- Hit F9. The images will be retrieved from their remote location. The result will look like this:
6: QR-CODES FROM GOOGLE MAPS
Google maps provides a simple and quick solution to generate QR-codes on the fly. The link looks like this:
http://chart.apis.google.com/chart?cht=qr&chld=L|0&choe=UTF-8&chs=96×96&chl=Peter Kaptein|peter@instantinterfaces.nl|Instant1
Try it here:
- Change the value of “chs”.
- Change the value of “chld” from “L” to “H” and back. The QR-code will become more detailed with “H” as it contains more information.
These are the different components:
- http://chart.apis.google.com/chart: the link to the Google charting API
- cht=qr: chart type is QR-code
- chld=L|0: minimal error correction: option “L” offers 7% error correction. Default is “H”. Option “L” contains only the basic info with minimal redundancy. “H” will contain more info and will be more detailed.
- choe=UTF-8: (character encoding) the character encoding.
- chs=96×96: (chart size) this defines the size of the QR-code including the white space around it. 96 x 96 pixels is approximately one inch if the default settings for Web-images is 96 pixels per inch.
- chl=<your text>: this is the parameter containing the information you want to encode.
7: GENERATING THE PERSONALIZED QR-CODE LINKS IN EXCEL
In this example we have 5 columns: first name, last name, e-mail, company and QR-code.
The link is created via a “concatenate” in Excel using the base URL in cell F1.
This base-url looks like this:
http://chart.apis.google.com/chart?cht=qr&chld=L|0&choe=UTF-8&chs=100×100&margin=0&chl=
The formula to create the personalized QR-code links is this:
=CONCATENATE(F$1; A2; ” “; B2;”|”;C2;”|”;D2)
Where in our example:
A = first name
B = Last name
C = e-mail
D = company name
I use the “|” to separate the different data items.
8: GETTING THE SIZE RIGHT IN WORD
The resolution of the QR-code set in “chs” defines the size it is displayed. The API will always display whole pixels for each bit. So when the data does not fit in the size you gave the API, it will scale the QR-code down from i.e. 2×2 pixels per bit to 1×1 pixels per bit.
By default Word is set to 92DPI per pixel. If you want your QR-code to be printed out in a flexible size like 1.2 x 1.2 centimeters, the best thing to do is to change the print resolution:
- Open “Word options”
- Select “Advanced” in the panel (Word 2007)
- Scroll down
- Click the button “Web options”
- Select the tab “Pictures” in the popup
- Set the DPI to any number. I choose 200 DPI with a QR code of 100 x 100 pixels. This screenshot shows 250 DPI
It is by balancing the DPI settings in Word and the pixel-size of the QR code in the Google API where you will get it right.
A simple formula to get the right size is this:
2.5 centimeter = 1 Inch
QRcm = QRpixels / (2.5 * DPI)
QRcm = Size of QR-code in centimeters
QRpixels = Pixel size QR-code
DPI = Pixels Per Inch as set for printing web images in Word
9: CONCLUSION
Using this approach you can create bulk-codes personalized per person. Using Word for this brings it’s quirks and requires your hand AND feet to get the results but generates at least a standard. Once it is working, it is working.
darrin
May 17, 2011
I have a question, when I test the qr code using the above process (which is very cool) the qr code is a type = Text. What would I need to change to have it read as an type = Address?
Thanks!
Peter Kaptein
February 28, 2012
I do not know. I guess the Google API provides in this. I have not investigated that path (and unfortunately do not have the time to do so). I hope you found the solution…
David Austin
September 11, 2011
Thank you, I can make most of your suggestion above work. However, I do the following that doesn’t work properly:
1. I merge the data and preview it for a set of labels. Each row looks ok but does not have the QR code. Each row has unique data from the data source.
2. When I update the QR codes using Ctrl-A (Select All) and Update (F9), the every label has the same content even though each row in the data source is unique.
3. I can toggle the data preview and get unique data again, but the QR code from the first record is still copied to all subsequent records.
Can you offer an idea about getting the QR code image to update for a unique image in each unique record?
Matthew Cathell
October 28, 2011
I found I needed a different concatenate function (using Excel for Mac 2011). Mine looks like this:
I have four columns of info (Title, First, Last, and Organization).
=CONCATENATE(“http://chart.apis.google.com/chart?cht=qr&chs=300×300&chl=”,D3,”%20″,E3,”%20″,F3,”%0D%0A”,G3,”&chld=H|0″)
Matthew Cathell
October 28, 2011
One other note for users of Mac version of word. I had to download an extra toolbar to get access to some of the functions needed, like inserting a blank field.
http://www.agentjim.com/MVP/Word/word2011toolbar.html
Matthew Cathell
October 28, 2011
So I successfully have a QR code appearing — but it’s the same code over and over. It’s not using each successive URL in the Excel sheet, just the very first one. Any suggestions?
Peter Kaptein
February 28, 2012
Press F9. Word does not update the image until you force it to.
Myah Myers
February 28, 2012
The round of applause for your post.Thanks Again. Really Cool.
Kenneth
March 4, 2013
Very good post. Thank you for posting it, I will surely be coming back to this blog