The function pagestyle inserts a section break and applies the page settings from the specified page style document.
@(pagestyle (label; template))
The result of the function pagestyle is of type TEXT. This function has two parameters:
The result of the function pagestyle is of type TEXT. It must be put into the result document to have an effect.
The first time the function pagestyle is applied to a result document it will not insert a section break. This allows the model developer to use this function to set the page style for the initial section of the document. Any subsequent applications will automatically insert a new section break. If the function pagestyle is applied for the first time after producing some initial pages, the model developer is responsible for inserting a section break manually, directly before the function pagestyle.
In ITP/CCM models the function pagestyle will not insert a section break the first time it is used for any document or document alternative produced by the ITP Model. Any subsequent applications within each document or document alternative will automatically insert a new section break.
The attributes of the section break are derived from the first section of the template document. Headers and footers are not copied from the template document but inherited from the previous section (if any) of the result document. The functions headers and footers can be used to make changes to the section.
Use of the function pagestyle will also set the 'different odd and even' setting in the result document. If any of the template documents has this option enabled it will also be enabled in the result document. If none of the template documents has this option enabled it will be disabled in the result document. This feature can be disabled with the function pragma.
The functionality of the function pagestyle is only available for the for ITP Microsoft Word output (both DOC and DOCX), it will be ignored for other document formats.
You cannot use the function pagestyle to introduce a section break within a table in the result document. This will result in a runtime error. If the new section must begin with a table, the function pagestyle must be called before the table is created.
Example
# BEGIN
#
@(pagestyle ("Insurance For Life"; "Invoice"))
#
#
@(pagestyle ("Insurance For Life"; "Policy"))
#
END #
The templates must be stored on the file system using the following convention;
<base directory>\<lbl>\Page-<tpl>.doc
According this convention;
The example above uses the following 2 documents to apply the styles:
Microsoft Word documents will by default start with a section that has the property New page. You can change this in Page Properties of the template document to any other section type, and this property will be inherited by the function pagestyle.