Use Libraries
Libraries contain different kinds of functions and procedures, such as:
-
Formatting functions used to format Fields in Text Blocks.
You can extend the list of available functions by defining your own format functions in a Library.
-
Filter functions used to filter Text Blocks in Text Block Lists.
The following restrictions apply when removing or renaming Libraries:
- Library functions cannot be renamed or removed after the Code Library has been unlocked.
- A Library cannot be renamed or removed if an object refers to one of the functions it contains.
Create and edit a Library
- Navigate to .
-
Click
Libraries and then click
New Library in the
New pane on the right.
The New Library window appears.
-
Enter a name for the new
Library and a level and click
OK.
All Libraries have to be assigned unique level numbers. Level numbers determine the order in which the contents are loaded. Libraries with higher levels have priority over libraries with lower levels. The default level is 100.
The new Library appears in Libraries.
-
Click the new
Library and then click
Edit in the
View and Edit pane on the right.
The Library opens in the Library Editor. If you have Microsoft Word 2016 or later, then a Word-based Library opens in Microsoft Word.
-
Add or paste the necessary code to the
Library. Note, that the functions here must be placed between the
# BEGIN and
END # statements, for example:
# BEGIN EXPORT FUNC TEXT set_headers(CONST TEXT brand; CONST TEXT document_type) DO FIELDSET Headers TEXT path := "\Headers and footers\" + brand + "\" + document_type + "\" TEXT text_block := path + "Header" IF text_block_exists(text_block; 0) THEN TEXTBLOCK VAR text_block ASSIGN_TO Headers.First FI ASSIGN text_block := path + "Header" IF text_block_exists(text_block; 0) THEN TEXTBLOCK VAR text_block ASSIGN_TO Headers.Odd FI ASSIGN text_block := path + "Header" IF text_block_exists(text_block; 0) THEN TEXTBLOCK VAR text_block ASSIGN_TO Headers.Even FI ASSIGN set_headers := headers(Headers.First; Headers.Odd; Headers.Even) OD END #The # BEGIN and END # statements can also be written as follows:
#BEGIN ... END# -
Save the
Library and close the editor.
If an error occurs, click Show Error Document.