Invalid 2D Barcode Right Edge (_x00D_) when Using Excel 2010 as Mail Merge Source

SYMPTOMS

You are using Excel 2010 as the mail merge source. In Excel, you set up a column to hold the barcode string, which is formula like QRCodeEncode(A2, 0, 0), as described in the product manual. However, after formatting the field with the font, extra blacks appear at the right edge. Close inspection discovers that each line in the barcode string contains _x00D_ at the end.

The problem does not happen in earlier Office 2007 and 2003.

CAUSE

Word 2010 changes 0x0d (the carriage return) character as _x00D_ string.

RESOLUTION

To work around the issue, substitute 0x0d with space. You need to perform the substitute in the data source. For example, in Excel if your formula is QRCodeEncode(G2,0,0), change it to SUBSTITUTE(QRCodeEncode(G2,0,0), CHAR(13), "") and copy the formula to other cells under the same column.