0

When using legacy form controls in Microsoft Word, it is easy to set up an edit box, assign a bookmark name to it, click on "Calculate on exit" checkbox in its properties, protect the document (only allow form filling) and then fetch whatever user has entered in it via {REF} field. The whole thing works without VBA and persists when saved in .docx files (macro-free).

And now I am trying to do the same with a legacy checkbox, but the value its bookmark returns is always blank.

See illustration below: enter image description here

So the question is: how do you read out the value of the legacy checkbox in the field without using VBA? I can't save macro-enabled file in this particular case and need to stick to macro-free .docx format.

2 Answers2

1

The conventional wisdom is that you can't do this just using field codes, and the simplest workaround using that particular type of field code (legacy non-ActiveX FORM fields) is to use a drop down form field with (say) Yes and No options. If the dropdown's bookmark is Dropdown1, then you can use something like

{ IF { Dropdown1 } = "Yes" "some text" "some other text" }

I believe that is actually the safest way to go using that generation of form field.

OTOH you might be able to get away with this, although I suspect that even if you can get it to work, problems outweigh any convenience factor involved.

Say your document's path is c:\a\mydoc.docx, and your Checkbox bookmark name is CHeck1, then insert the following LINK field:

{ LINK Word.Document.12 "C:\\a\\mydoc.docx Check1 \a \t \#"'checked';;'unchecked'" }

Enable protection for forms in the usual way, then check/uncheck the box.

Here, the LINK field does update, but after a short pause.

LINK fields can also be hard to maintain because you have to have an absolute path to the document, and that will change if you move the document.

Something similar appears to work on the Mac version of Word, except that you cannot use the # numeric format field, and you have to use an IF field instead, e.g. something more like

{ IF { LINK Word.Document.12 "/Users/username/a/mydoc.docx" Check1 \a \t } = 1 "checked" "unchecked" }

but you can't use that on Windows Word because it doesn't update automatically!

jonsson
  • 777
0

As suggested in Jonsson's comment, you should be able to use a Mapped Content Control Checkbox and rather than a REF field, use a copy of the Content Control where you want the result.

Be aware that the copies will also be active and be able to be checked or unchecked.

See: