View Single Post
 
Old 03-02-2014, 03:37 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Ulodesk View Post
What I am now stumped on is how to use this with a checkbox.
If you're using checkboxes, you don't need either custom document properties or DOCPROPERTY fields, though they can still be used. For example, instead of using either custom document properties or DOCPROPERTY fields, you could use
{INCLUDETEXT "{FILENAME \p }/../Text1.docx" "Check{IF{REF Check1}= TRUE 2 1}"}
Using checkboxes does required a macro but, given you document is using formfields, you could use dropdown formfields for the same purpose and that would not require a macro.
Quote:
Let's say, for example, that I have a client who needs solutions for issues 1,4,7, and 13. I open my target doc, and as I check the relevant check boxes, those selected solutions are brought in on page two, which I then print out and hand to my client. That's the principle.
In that case, it's a simple matter of having one per checkbox. For example:
{INCLUDETEXT "{FILENAME \p }/../Text1.docx" "Check1{IF{REF Check1}= TRUE 2 1}"}
{INCLUDETEXT "{FILENAME \p }/../Text1.docx" "Check2{IF{REF Check2}= TRUE 2 1}"}
{INCLUDETEXT "{FILENAME \p }/../Text1.docx" "Check3{IF{REF Check3}= TRUE 2 1}"}
(Note the additional number in the bookmarks to cater for the additional checkboxes; you could just as easily use letters or something else - you could even replace the outer 'Check1', 'Check2', etc with meaningful names). The important thing to remember is that you need two bookmarks per checkbox - one for whatever is to be output for the True value and one for the False value, even if one of those is empty. You can even add more logic for what happens if two particular checkbox values are true, for example.
[quote]I can find "toggle field codes" but not "toggle bookmark references".
The toggling referred to consisted of changing the value between 1 & 2 (though you could use 0 & 1 to 'equate' to False & True); this has nothing to do with toggling the field code display.
Quote:
I had no idea this would require so much time.
The time investment is largely because you're getting into an area few people work with and is poorly documented. In reality, mastering what can be achieved via field codes is no more difficult than achieving a similar level of proficiency in postscript programming, for example (I've done that, too).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote