BaseExtensions can be used to select a specific content control based on its name in Word, and replace existing content if needed. This feature works as a support for inserting specific content directly in a document. Thus, this could be used in conjunction with our appendix feature.
Module is located here:
...\ModuleLibrary\BaseExtensions\04_nocontext_MISC\11_W_selectNamedContentControl.xml
CMD
<Cmd case="BaseExtensions:select-named-cc" name="x"/>
Parameter
name
Define the name of the content control that should be selected. When using this feature in conjunction with our Appendix feature, this is the content control where all content within should be changed to the content defined in the Appendix feature. If there is no content control with the given name, it will create a new content control where the cursor is and name it after this parameter. If there are several content controls with this name, the feature will choose the first one in the document.
clear
Set this parameter to be true
if the command should clear the content control when it is selected. If the selected content control has content within and the command is used in conjunction with another that should insert something in the selected content control, this makes sure that it will be replaced. If the parameter is set to false
, the existing content will be kept in the content control.
onlyContent
Define whether the command should select the actual content control or only mark the text inside. If true
, the command will only select the text within. If false
, the command will select the entire content control.
addCcIfMissing
Define whether the command should add a content control if the defined name is missing in the document using true
or false
. Default is true
.
Comments
0 comments
Article is closed for comments.