New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

How to perform a mail-merge from Excel to Word using 2D barcodes

I am using your 2D barcode fonts (Data Matrix) and I can encode the data in Excel using your VBA encoder but the mail merge is incorrect. I made sure to apply the barcode font after the merged field but there are characters after the barcode, _x000D_


Application: Mail Merge (Excel and Word)

07-18-12     11.6 year(s) ago    

  Report Abuse

 

Ben

Best Answer

Forum Post Updated: 11/17/2021

Note: an additional support solution is also available that removes the _x000D_ character from appearing in the Word merge result.


I will provide instructions from beginning to end on how to generate a barcode from Excel to Word for Mail Merge using 2D barcode fonts (Data Matrix) and the Barcode Add-In. The _x000D_ is caused when Word cannot properly interpret the carriage return. It is possible to use the SUBSTITUTE function in Excel to correct the issue.

DOWNLOAD AND INSTALL
1. Download and install the 2D barcode package. In the example, I will use Data Matrix.

Other 2D barcode types:
Aztec
QR Code
PDF417
Maxicode

EXCEL
2. Open Excel and set up the spreadsheet. In the example, data in column A2 will include the data to convert to the barcode. A formula will be written in B2 to produce the encoded data.

image



3. Minimize Excel and locate the VBA file named IDAutomation_VBA_DataMatrix_FE2021.bas or (IDAutomation_Datamatrix_Macro.bas--Demo verison). The VBA is located in the Integration folder of the product download.
image

Other 2D barcode types:
PDF417 uses IDAutomation_PDF417_Macro.bas
QR Code uses IDAutomation_QR_FontEncoder_VBA_DEMO.bas or IDAutomation_VBA_QRCodeFE2021.bas (licensed)


4. Maximize Excel and select the Developer Tab.

image



5. Select Visual Basic to enter the Editor.
image



6. To import the VBA file select File -- Import File then search for and select the .bas file.

image

The VBA file will appear in the Modules folder.



7. NOTE: If using the demo file (IDAutomation_Datamatrix_Macro.bas), you must complete this step. Otherwise, skip to step 8. Select Tools -- References and search for the Data Matrix encoder. Choose OK.
image



8. Select File and choose Close and Return to Microsoft Excel.
image


9. Encode the data by entering the formula. In cell B2, enter the formula =EncDM and reference cell A2 to encode the data. If using the FontEncoder.bas file, use =IDAutomation_DMatrix_FontEncoder. Press return. Drag the corner to encode the remaining data.
image
The data in Column B is encoded.


10. To avoid the _x000D_ issue that may occur in the Mail Merge, apply the Substitute function and replace the carriage return. =SUBSTITUTE(IDAutomation_DMatrix_FontEncoder(A2), CHAR(13),"")

NOTE: =EncDM() and =IDAutomation_DMatrix_FontEncoder() is specific to Data Matrix.

To encode PDF417 for mail merge use, =SUBSTITUTE(IDAutomation_PDF417(A2), CHAR(13),"")

To encode QR Code for mail merge use, =SUBSTITUTE(IDAutomation_QRCode_FontEncoder (A2), CHAR(13),"") or demo version =SUBSTITUTE(IDAutomation_QRCode_FontEncoder_DEMO (A2), CHAR(13),"")


WORD
11. Open Word and perform a Mail Merge. Users inexperienced with Word should use the Mail Merge Wizard or visit the Microsoft Office Website.

12. During the Mail Merge Recipients step, the _x000D_ in the encoded data should no longer appear.
image

13. Insert the Merge Fields.
image

14. When the Barcode field is merged, spaces may appear between the encoded data.
image

Choose the No Spacing option in the Home tab.
image

The encoded data should appear correct.
image

15. Select the barcode font in the field. In the example, IDAutomation2D is used.
image

Posted 11.6 year(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.

Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook