removeTemplateVariable
- 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
removeTemplateVariable
BASIC / ADVANCED / PREMIUM
Removes a Javadocx placeholder variable from the Word document.
Description
public void removeTemplateVariable(String variable)
public void removeTemplateVariable(String variable, String type)
public void removeTemplateVariable(String variable, String type, String target)
This method allows to remove an "unused" placeholder variable.
There are two options: just remove the placeholder variable (type = "inline") or remove the whole paragraph that contains it (type = "block").
Parameters
variable
The name of the variable you want to remove.
type
It may be "inline" if one wants just to remove the variable or "block" (default value) if one wants also to remove the containing paragraph.
target
Possible values are: document (default value), header, footer, footnote, endnote or comment.
Code samples
Example #1