I found this old forum post (BUG: Long mail merge fields - values not appearing in output) which describes my issue pretty well, but don’t see a solution.
Basically, our application allows users to define their own mail merge field names, but when these names exceed 40+ characters they appear as truncated in Microsoft Word. For example, if the mail merge field name was “Customer_Order_Detail_Product_Option_Name”, which is 42 characters long, when attempting to select it from the mail merge menu in Word, it would appear as “Customer_Order_Detail_Product_Option_Nam” (notice the last character “e” was removed).
Also, if we had multiple fields with the same 40+ character prefix like:
“Customer_Order_Detail_Product_Option_Price_Retail” (50 chars)
“Customer_Order_Detail_Product_Option_Price_Sale” (48 chars)
“Customer_Order_Detail_Product_Option_Price_Discount” (52 chars)
Word would display these as:
“Customer_Order_Detail_Product_Option_Pri”
“Customer_Order_Detail_Product_Option_Pr1”
“Customer_Order_Detail_Product_Option_Pr2”
And the person trying to work with the template wouldn’t know what the “Pri”, “Pr1”, and “Pr2” suffixes are referring to.
As bad as that is, I can sort of live with it (since that’s just the way Word works what choice do I have)…but the real problem is that when we programmatically run the mail merge process, our data fails to map to the truncated name and the merge field is NOT replaced. This is because we’re mapping our data to the non-truncated merge field name.
Is there any solution to this besides forcing our users to not exceed 40+ characters (which is extremely limiting)?