We'd rather use Word docs for this and we're moving our entire system to Java anyway so I found docx4j ... seems that it can do what I need, but I'm not finding examples and using the online demo/doc explorer is not overly helpful. (SO. MANY. TAGS.)
Basically what I need to do is either, get the current value of a content control, by name (either w:tag or w:alias) - or set said value (also by tag/alias, of course). Are there examples out there somewhere, or a clearer documentation on how to achieve this? The huge amount of nesting and such is making it very hard to figure out how to proceed.
Here's an example field from the test document I'm playing with, as displayed by the online demo:
Online Demo wrote: <w:sdt>
<w:sdtPr>
<w:rPr>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:alias w:val="jmc-enc-type-title"/>
<w:tag w:val="jmc-enc-type-tag"/>
<w:id w:val="1583019566"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_1081868575"/>
</w:placeholder>
<w:showingPlcHdr/>
<w:comboBox>
<w:listItem w:value="Choose an item."/>
<w:listItem w:displayText="Evaluation" w:value="Evaluation"/>
<w:listItem w:displayText="Dispensing" w:value="Dispensing"/>
<w:listItem w:displayText="Follow Up" w:value="Follow Up"/>
</w:comboBox>
</w:sdtPr>
<w:sdtEndPr/>
<w:sdtContent>
<w:tc>
<w:tcPr>
<w:tcW w:w="2366" w:type="dxa"/>
<w:vAlign w:val="center"/>
</w:tcPr>
<w:p w14:paraId="12A46C18" w14:textId="77777777">
<w:pPr>
<w:rPr>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rStyle w:val="PlaceholderText"/>
</w:rPr>
<w:t>Choose an item.</w:t>
</w:r>
</w:p>
</w:tc>
</w:sdtContent>
</w:sdt>
Here the tag/alias are both set to "jmc-enc-type-title"/"jmc-enc-type-tag" (they are called title/tag in Word). I would need to either read what the combobox is currently set to, or set it to a new value. (Selected value.)