Find and replace in Docx
Finds and replaces keywords in a docx file.
#
Designer Properties- Docx File Path The doc file path to find and replace keys.
- Key Value Dictionary The Dictionary(string, string) with the keys, and their corresponding values to be replaced in the dictionary.
- Output file Path Path to the file that will contain the original document with the keys replaced.
#
Properties#
Document PropertiesSee Designer Properties above.
#
General PropertiesSee General Properties.
#
MiscSee Misc.
#
Out ErrorSee Out Error.
#
Result- Generated File Path to the file that will contain the original document with the keys replaced.
- Parse Error The parsing errors reported while processing the docx file.
#
Tags- Text End Tag The end tag for the key to be replaced. By default, it is ##.
- Text Start Tag The start tag for the key to be replaced. By default, it is ##. For instance, if we want to add a key to be replaced in a docx file using the default values for tags, the key should look like "##key##" where key is the "key" specified in the Key Value Dictionary.
#
ExampleFind and Replace tokens in docx file
Sample Docx file In this example, we load a sample docx file, look for keys: "first, second" and replace them with test1, test2.
The dictionary with keys and values is specified as:
The "key values" dictionary is entered using the expression editor.
To open the Expression editor just clicking on the "..." button in properties panel for Key Value Dictionary.