Word 2013 displaybarcode field sometimes generates error in earlier versions of Word rather than blank.

Word 2013 introduced two new fields: DisplayBarCode and MergeBarCode with little documentation. I've tried to implement the DisplayBarCode field in my Bar Code Add-In and discovered that when the field is used in earlier versions in many cases it simply displays as blank. Nothing shows on the screen (which is what I would like).

However, in many cases, it throws an "Error. Bookmark not defined." in bold.

I've tried to get around this using a containing IF field but have not been successful. It either shows the error or shows nothing in Word 2013 as well. The one below displays nothing in Word 2013 as well.

{ If "{ DisplayBarCode http://addbalance.com/word/download.htm#BarCodeAddIn QR }" = "Error! Bookmark not defined." "" "{ DisplayBarCode http://addbalance.com/word/download.htm#BarCodeAddIn QR }" }

Any suggestions on the structure of the IF field? Perhaps this field is simply one that cannot successfully be used in an IF field.

Of course, I can avoid this by using another program to generate the bar code and then insert it as an image. This has the advantage of displaying the code in all versions. I'm just curious as to why the IF field is not working.

Answer
Answer

You might be able to use this:

{ SET DisplayBarCode " " }{ IF "{ DisplayBarCode X }" = " " "Insert what you want for Word versions prior to 2013{ SET DisplayBarCode "" }" }{  DisplayBarCode http://addbalance.com/word/download.htm#BarCodeAddIn QR }

But once the document has been opened in Word 2013 and saved, the chances are that WOrd 2010 will see the image rather than the field.


Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated September 25, 2022 Views 2,391 Applies to: