Skip to main content
Mail merging is a process whereby merge fields interspersed through your standard or static text are replaced from a data source when printed. This feature allows you to send one document to many recipients, with the personalized details for each. We are quite often asked if our B-Coder Pro software can insert PostNET barcodes into a Word document or in a mail merge within Word. The answer is “Yes”. However, Word already has built-in support for this type of functionality, so you do not need any additional software to accomplish this. You just need to know how to use the features that are already in Word.

Getting started with Mail Merge

Use the following steps to insert a barcode field into a mail merge document: First, select Tools > Mail Merge Word Tools menu with the Mail Merge option highlighted (Figure 1: Starting a new Mail Merge) A Wizard called the Mail Merge Helper will appear. The first step is to tell it which sort of document you wish to create. If you select “Mailing Labels” or “Envelopes” you will be presented with a nice button for inserting PostNet barcodes, but for other types of documents you must modify the merge field manually to insert PostNet barcodes. More on that later. For now, simply select “Form Letters”: Mail Merge Helper dialog with the Create button dropdown showing the Form Letters option (Figure 2: The Mail Merge Helper) You can choose to use the currently open Word document or to open a new document. Microsoft Word dialog asking whether to use the active document window or a new main document (Figure 3: Choosing a document to merge to) If you want to use an Excel Spreadsheet (or an Access database) as the source of data for your merge fields, choose the Open Data Source … option, under the Get Data Source item.

Selecting a data source

Mail Merge Helper dialog with the Get Data dropdown showing the Open Data Source option (Figure 4: Opening a Link to Excel) This will open up a file navigation dialog box shown below. Use this dialog box to point to the correct Excel Spreadsheet file (or Access database) that contains the merge field information. Open Data Source dialog for selecting the Excel spreadsheet file to merge from (Figure 5: Selecting the right Excel Spreadsheet) When merging with an Excel Spreadsheet you will be offered a choice of named ranges – if any exist – or the entire spreadsheet. (If you are merging with an Access Database you will be offered a choice of which table (or query) you wish to use as a source for your merge fields.) Microsoft Excel dialog for choosing a named range or the entire spreadsheet (Figure 6: Choosing a Range from a Spreadsheet)

Inserting merge fields

The merge fields should appear in a temporary toolbar in Word, corresponding to the field names in the Excel Spreadsheet. Click on it, and a drop-down selection of merge fields appears. Just select a field and it is inserted into the document. Word Insert Merge Field dropdown listing available field names including Zip (Figure 7: A dropdown selection of merge fields to choose from) In this example, the merge fields from the spreadsheet have been inserted in between the standard text. Once merged, the correct value of each record will be substituted where the merge fields are located. Word document showing merge fields inserted between static letter text (Figure 8: Mixing your static text with the merge fields)

Inserting the barcode field

Place the cursor in the document where you want the barcode to appear and insert a barcode field into the document. To do this, select “Field…” from the INSERT menu in Word then choose the Barcode field and click OK to insert the barcode. Word Field dialog with the BarCode field selected under the Mail Merge category (Figure 9: Manually inserting the barcode field) You should now be looking at the word Error! where your barcode ought to be. Press Alt + F9 to toggle the field codes so that your document now looks something like figure 10: Word document showing the merge field codes, including the BARCODE field, with formatting switches visible (Figure 10: Displaying the field codes) Place your cursor in front of the *: Word document showing the cursor positioned before the asterisk in the BARCODE field code (Figure 11: Positioning your cursor) Click on Insert Merge Field and select your zip code field. The field should now read: { BARCODE { MERGEFIELD Zip }* MERGEFORMAT } Press Alt + F9 again to toggle the field codes off and you should now see the barcode based on your first record.

Completing the merge

Now that the Main document is prepared, you are ready for the merge. If you don’t want to use all the records in the SelectClient table then you can use the Query Options in the Mail Merge Helper. Mail Merge Helper dialog with the Query Options button highlighted (Figure 12: Mail Merge Helper Query Options) Clicking on Query Options brings up a dialog which lets you choose a part of your table. In this example, we are limiting the mail merge only to those whose suburb is “Chatswood”. Query Options dialog filtering records where the Suburb field equals Chatswood (Figure 13: Refining the records which will be merged into the document) The Mail Merge helper will now let you output the result in a variety of ways. In order to preview your document before printing you should select Merge to: New document. This will create a single document containing all the letters (or Labels). Merge dialog with Merge to New document selected (Figure 14: This creates one document containing each merge instance) After you complete the merge your document should look something like this: Word document after the mail merge, showing a POSTNET barcode printed below the recipient address (Figure 15: The Post-Merge document) If the above technique does not do what you want exactly, you might want to try our B-Coder Pro software. You can download a fully functional demo version from our free trial downloads page. B-Coder Pro comes with several Word macros that make the job of adding barcodes to documents extremely easy.
Last modified on November 3, 2026