Automating bard code creation in Word 2003 RRS feed

  • Question

  • Hi!

    I'm trying to setup a bit of automation in Word so that when someone enters a reference number in a document, it is automatically converted in to a barcode at the bottom of the document, so far I've managed this in as much as using forms, but when protecting the form no text can be entered outside the form - which is a bit of a problem!

    I'm hoping someone here might be able to help me :o)


    Tuesday, May 14, 2013 7:10 AM


  • Assuming you're using nothing more complicated than a 3of9 barcode, you'll need a formfield into which you can insert the number and a cross-reference to it plus, of course, a 3of9 barcode font. For anything more complicated, you'll need a macro that translates your input into the required barcode string and some slightly different field coding.

    Assuming  a 3of9 barcode, add a formfield to the document for the data entry.

    With your formfield, set its properties to numeric format, with 'calculate on exit'. Take note of its internal bookmark name, too.

    For the barcode, select the insertion point, press Ctrl-F9 twice to create a pair of nested fields, thus: {{}}. Edit the fields so you end up with {QUOTE "*{=BkMk \# 0}*" \* Charformat}, where BkMk is your formfield's internal bookmark name. Next, format the Q in QUOTE with your 3of9 barcode font, in the required point size.

    Finally, apply the forms protection, input the barcode #, then press TAB.

    Paul Edstein
    [MS MVP - Word]

    Tuesday, May 14, 2013 10:22 AM