tickCheckboxes
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
tickCheckboxes
BASIC / ADVANCED / PREMIUM
Ticks or unticks a checkbox in a Word document.
Description
public void tickCheckboxes(HashMap<String, Integer> variables)
This method allows to modify the state of a checkbox in a Word template. It accepts:
- legacy checkboxes.
- Word 2010 checkboxes.
You should tag those checboxes so they are recognized by Javadocx as follows:
- Legacy checkboxes:
- Go to the developers ribbon tab.
- Select the checkbox you want to tag.
- Click in the "Properties" option in the "Controls" menu entry.
- A pop up window will open.
- Click on "Add Help Text ..." button.
- Activate in the "Status bar" tab the "type your own" option.
- Write the variable name surrounded by the template symbol of your choice ($ by default).
- Word 2010 checkboxes:
- Go to the developers ribbon tab.
- Select the checkbox you want to tag.
- Click in the "Properties" option in the "Controls" menu entry.
- A pop up window will open.
- Write the variable name in the "Tag" input text box surrounded by the template symbol of your choice ($ by default).
Word 2010 checkboxes are not correctly visualized in Word 2007 so use them only in case that you are sure that your final users will use Word 2010 or higher.
Parameters
variable
A HashMap with the names of the variables as keys and values 0 or 1 (ticked or unticked respectively).