replaceVariableByWordML
- 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
replaceVariableByWordML
BASIC / ADVANCED / PREMIUM
Replaces placeholder variables by plain WordML code.
Description
public void replaceVariableByWordML(HashMap<String, String> variables) throws Exception
public void replaceVariableByWordML(HashMap<String, String> variables, OptionsReplaceVariableByWordFragment options) throws Exception
This method (avalaible for the seasoned Javadocx user) allows the direct substitution of placeholder variables by WordML code.
Only use this method if you really understand the OOXML standard. Javadocx does not validate the WordML against any scheme so you have to make sure by your own that the WordML is correctly encoded. Moreover, this method does not take care by its own of internal/external relationships included in the WordML code.
Parameters
variables
This must be a HashMap with the names of the placeholder template variables as keys and the WordML strings that should replace them as values.
options
Option | Type | Description |
---|---|---|
firstMatch | Boolean | If the variable appears more than once within the Word document and firstMatch is set to true, Javadocx will only replace the first ocurrence of the variable within the Word document. |
target | String | Possible values are: document, header, footer, footnote, endnote, comment. This option sets the scope of the replacement procedure. |
type | String | Possible values are:
|