Inserting Field Codes into Your RTF Output

Microsoft Word has field codes, such as the PAGE or NUMPAGES or DATE fields that we saw in previous examples. This example demonstrates how to use field codes to insert the filename or path of the RTF file into the footnote of an RTF document that ODS is creating. There are no ODS RTF statement options to accomplish this common task, so it is necessary to use field codes.

As seen in previous examples, it is necessary to turn off the protection of special characters such as the backward slash (\) and curly braces ({}) used by RTF. This is done either by setting an escape character and applying the style attribute PROTECTSPECIALCHARS=OFF before the first usage of the RTF control word in the statement ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.