User`s guide

Automatically Number Document Content
13-89
chapHead.Style = {CounterInc('chapter'), ...
CounterReset('table'), ...
WhiteSpace('preserve')};
append(d,chapHead);
for i = 0:1;
tableHead = Paragraph('Table ');
append(tableHead,AutoNumber('chapter'))
append(tableHead,'.');
append(tableHead, AutoNumber('table'));
append(tableHead, ...
sprintf('. Rank %i Magic Square',rank+i));
tableHead.Style = {CounterInc('table'), ...
Bold, ...
FontSize('11pt'), ...
WhiteSpace('preserve')};
append(d,tableHead);
table = append(d,magic(rank+i));
table.Width = '2in';
end
end
close(d);
rptview(d.OutputPath);
Automatically Number Content Using Part Templates
You can automatically number a document by creating document parts based on
templates containing Microsoft Word or HTML automatic numbering and repeatedly
appending the parts to a document.
For example, suppose that you add a chapter part template Chapter to the part
template library of the Word MyReportTemplate.dotx report template. This template
uses a Word sequence (SEQ) field to number the chapter heading. The template also
contains holes for the chapter title and the chapter content.
This script uses the chapter part template to create numbered chapters. The last
statement in this script opens the report in Word and updates it. Updating the report
causes Word to replace the SEQ fields with the chapter numbers.