I'm working on a book to be published in both paper and digital form. The prose part of the book can reflow on digital devices, but the book has a lot of displayed sections of programming code, and reflowing such displays (i.e., changing the line breaks) is highly undesirable. Some devices offer much longer lines than others, so one approach I'm considering is producing a manuscript where each code display is available in two forms: for wide displays and for narrow ones. To really make this work, I'd like to have conditional text in Word, because that will make it possible to produce two versions of the manuscript, one with wide lines in code displays and one with narrow ones.
I've done a lot of googling for conditional text support in Word, and the results are discouraging. SmartDocs from ThirtySix software seems like it would support what I want, but their product costs $695/year, which doesn't make a lot of financial sense for an independent author. Livelinx's Conditional Text appears to be an abandoned product, and the macros published in Gary Calwell's article don't handle braces in conditional text (which is a problem for me, because programming code displays contain lots of braces). A thread in an MS Community forum as well as one in in the Office Dev Center offer leads regarding DIY solutions, but my goal is to write a book, not to learn VBA.
Am I approaching this problem the wrong way? Is there an approach to conditional text (or, more generally, conditional content) in Word 2010 I should be considering? It just seems like it should not be that difficult to say "if (lines are wide) display this text, otherwise display this other text."
Thanks for any help and guidance you can offer.