The task is to create a (long) structured document -- it has a bunch of content that is relatively static, and one section that consists of about a thousand question/answer structured blocks that starts off with a table containing a bunch of checkboxes. Contractually, the end result has to be a Microsoft Word document.

The usual approach is just to start writing using a Microsoft Word template. However, it seems to me that MS Word is not conducive to clear thought, particularly when a thousand points are required. When I look at other's work using a similar template (these are "system security documents") I find that often people are non-responsive, and I'm guessing its just that the document has so many moving parts. It also strikes me that its difficult to maintain over time (these are supposed to be 'living documents').

My approach was to store all the complicated structured part in a database back end, and then render into something close to the desired format; then have a copy of the Microsoft Word template with the static stuff filled in, and then just insert the rendered text. I can come reasonably close by using html and checkboxes, then figured that the insert would carry the thing home.

(Ok, so I really like the idea of a database for lots of other reasons: to prepare for CDM and work across multiple SSPs, to be able to have decent change control and external analysis, to be able to run statistics on the language, etc. A flat textual document just isn't a good approach, imho.)

However, it seems like its not doing so -- perhaps because of size/memory issues, perhaps because of openoffice / libreoffice / MS Word conversions, the checkboxes look awful. So, I'm casting about for an alternative -- rendering directly into MS Word.

Another complication is that I work with a linux box, not a Windows box, so I'd rather have a native perl approach rather than Win::OLE. I've used that many times in the past, and could make that work I suppose, it just seems inelegant.

Is there something like EXCEL::Write::XLSX for microsoft word? Or is there a better way?


In reply to generating a microsoft word doc by WoodyWeaver

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.