Microsoft Word output reference

Review this information to learn more about generating Microsoft Word documents with Rational® Publishing Engine.

Purpose

To output the template into the following documents:
Extension Format of generated document
.doc Microsoft Word 2003.
.docx Microsoft Word 2007, without the ability to run macros.
.docm Microsoft Word 2007, with the ability to run macros.

Template elements

Table 1. Template elements available to use for the Microsoft Word output format
Element Description Can contain other elements Can contain data
Paragraph icon Paragraph Use to group a section of elements. Adds a carriage return around its child elements in the output. Yes No
Container icon Container Use to group a section of elements. Cannot be styled and does not affect the formatting of the output.
When used inside other elements, the child elements available to use within the container might be limited. For example:
  • Inside rows, containers can host cells only
  • Inside lists, containers can host list-detail elements only
Yes No
Text icon Text The content renders with the same, specified formatting. No Yes
Styled text icon Styled text A block of text that can have unique formatting on individual words. Use bold, italic, underline, strikeout, or color formatting on a selection of words within the element. The text is static. No Yes
Hyperlink icon Hyperlink Creates a hyperlink in the output. The hyperlink can point to a location inside the document or to an external location. No Yes
Image icon Image Displays as an image in the output. The document designer can specify the image path in the template or the document generator can specify the path at run time. No Yes
Table icon Table Creates a table in the output. A table can contain rows or container elements. Yes No
Row icon Row Creates a row in the current table. Yes No
Cell icon Cell Creates a cell in the current row of the current table. Yes No
List icon List Creates a bulleted or numeric list in the output. Yes No
List detail icon List detail Creates a list item in the current list in the output. Yes No
Data Source configuration icon Data source configuration See Creating dynamic data elements to define at run time. No No
Include file icon Include file Includes the specified file in the output as an INCLUDETEXT field.
  • For Microsoft Word output, the included file can have a .doc, .docx, .txt, or .rtf extension. You must update all fields in the Microsoft Word document to see the included file.
  • For PDF output, the included file can have a .doc or .docx extension.
  • For Legacy PDF, HTML, and XSL-FO output, the included file is a hyperlink to the document.
No Yes
Footnote icon Footnote Creates a footnote in the current output page. The text of the footnote is the content of the footnote element. Supported for Microsoft Word output only. No Yes
Region icon Region Regions are static elements that allow you to alter the output flow by redirecting the contents of other elements or groups of elements at their position. If an element has the target region property specified with the name of a region element, its content renders in the specified region instead of in its position in the document. No No
Bookmark icon Bookmark Defines a bookmark in the document. The name of the generated bookmark is the content for the bookmark. When generating the documents, Rational Publishing Engine generates a unique name for each bookmark. The name is based on the name provided at design time and a unique identifier generated at run time. No Yes
Comment icon Comment Adds a comment to the output. The form and shape of the output comment is specific to the output format.

Supported for Microsoft Word and PDF.

No Yes
Page Break icon Page Break Adds a page break to the output. No No
Section Break icon Section Break Adds a section break to the output. No No
Table of Contents icon Table of Contents Adds a table of contents to the output. No No
Table of Tables icon Table of Tables Adds a table of tables to the output. You must add Table Captions in your document template to generate a table of tables in the output.

Supported for Microsoft Word output only.

You must update all fields in the Microsoft Word document to see and be able to update the value of the field.

No No
Table of Tables icon Table of Tables Adds a table of tables to the output. You must add Table Captions in your document template to generate a table of tables in the output.

Supported for Microsoft Word output only.

You must update all fields in the Microsoft Word document to see and be able to update the value of the field.

No No
Field icon Field Adds a generic Microsoft Word field element. You can type any valid Microsoft Word code in the field code property.

Supported for Microsoft Word output only.

You must update all fields in the Microsoft Word document to see and be able to update the value of the field.

No No
Page Number icon Page Number Adds a page number in the output. Supported in Microsoft Word and PDF output only. No No
Total Pages Number icon Total Pages Number Adds the total number of pages in the output. Supported for Microsoft Word and PDF output only. No No
Table Caption icon Table Caption Adds a table caption. While you cannot specify dynamic content into a table caption, any subsequent text element is concatenated to it.

Supported for Microsoft Word and PDF outputs.

You must update all fields in the Microsoft Word document to see and be able to update the value of the field.

No No
Figure Caption icon Figure Caption Adds a figure caption. While you cannot specify dynamic content in a figure caption, any subsequent text element is concatenated to it.

Supported for Microsoft Word and PDF outputs.

You must update all fields in the Microsoft Word document to see and be able to update the value of the field.

No No

Element properties

Review these notes to understand more about specifying the element properties for templates that are designed to generate Microsoft Word documents.

Table 2. Cell properties
Cell properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
You must specify a border width value between 1 and 30 pixels to create a border in the output.
Cell alignment This property specifies the position of the text within the cell. The justify value is not supported for this output format.
Table 3. Figure caption properties
Figure caption properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.
Field code Arabic or Roman numerals display sequentially on each caption.
Table 4. Image properties
Image properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.
Table 5. List-detail properties
List-detail properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.
Table 6. Page number properties
Page number properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.
Table 7. Paragraph properties
Paragraph properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
You must specify a border width value between 1 and 30 pixels to create a border in the output.
Paragraph alignment Space the text across the page with a certain alignment.

Left, right, and center alignment, creates uneven paragraph edges, fitting as many words in a paragraph as possible. Justify creates even paragraph edges by inserting additional space between words on all lines except the last line. Distributed is similar to justify, except that space is also inserted between words in the last line of the paragraph.

Widow/orphan control When set to true, the line spacing is adjusted to prevent the following formatting results:
  • A single word ending a paragraph on a new line
  • A single line ending a paragraph on a new page

When set to false, spacing is not adjusted.

Table 8. Row properties
Row properties Notes
Break across pages When set to true, the content of a row that comes at the end of a page is split, if necessary. The content that does not fit on the page carries over onto the next page as a new row.

When set to false, the content of a row that comes at the end of the page is not split. The whole row carries over onto the next page.

Table 9. Table properties
Table properties Notes
Autofit to contents Resizes the table to fit the content each cell contains. When you use this property, also set the Resize to fit contents property to true.
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
You must specify a border width value between 1 and 30 pixels to create a border in the output.
Fixed cell width Specify a value in pixels to ensure that all of the cells in a column are the same width.
Resize to fit contents When set to true, lines do not break unless a space is present. When you do not have space, lines do not break and the column width is increased to the width of the text. If autofit to contents is set, you must set resize to fit contents to true.

When set to false, the column width is fixed and the lines break regardless of the spaces used or the length of the text. Also, the table auto fit property is ignored.

Table auto fit When set to true, the table is resized to fit the width of the page. When resize to fit contents is also set to true, cell widths are ignored and the table is resized to match the content.

In Rational Publishing Engine 1.1.2.1 and earlier, you can enter fixed column width as a value. In 1.1.2.2, you cannot enter fixed column width as a value. Use the fixed cell width property instead.

Width You must specify a value.
Table 10. Table caption properties
Table caption properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.
Field code Arabic or Roman numerals display sequentially on each caption.
Table 11. Text properties
Text properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
You must specify a border width value between 1 and 30 pixels to create a border in the output.
Table 12. Total pages number properties
Total pages number properties Notes
Border width
  • all borders width
  • top border width
  • right border width
  • bottom border width
  • left border width
Do not use for this output format.

Tables of contents, figures, and tables in Microsoft Word documents

To add a table of contents to your output, define the table of contents in your template or style sheet. If you define the table of contents in the template, the table is not shown in the Microsoft Word document until you update the document fields. To update the fields, use the Update Fields or Update Table feature in Microsoft Word or use the macros contained in the rpe.dot style sheet. You can find the rpe.dot style sheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot. The same process applies to tables of figures and tables of tables.

Captions in Microsoft Word documents

Figure and table captions are not automatically updated. To update the fields, use the Update Fields feature in Microsoft Word or use the macros contained in the rpe.dot style sheet. You can find the rpe.dot style sheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.

Include file element

The way that include file elements are handled depends on the output format.
For Microsoft Word output, an INCLUDE TEXT field is generated. This means that the task of importing the file is delegated to Microsoft Word. An include file is not visible in the output document until all fields are updated. To update the fields, use the Update Fields feature in Word or use the macros contained in the rpe.dot style sheet. You can find the rpe.dot style sheet in the Rational Publishing Engine installation: %RPE_HOME%\utils\word\rpe.dot.
Note: A Microsoft Word document linking other files is not self-contained. Moving the document on other computers prevents you from visualizing the content of the linked documents. If visualization is needed, use the Break links feature, which is Alt+E+K in Microsoft Office 2007, from Microsoft Word to include the contents of a linked files.

Heading styles

To use the predefined heading styles for Microsoft Word (Heading 1, Heading 2, ... , Heading 9) and HTML (H1, H2, ... , 9), use the style name 1,2, to 9. PDF and XSL-FO output formats do not have heading styles; however, Rational Publishing Engine uses internally defined heading styles.

Rational Publishing Engine styles versus external styles

If your main output is Microsoft Word or HTML, use external styles, which are defined in a style sheet, as much as possible. This approach allows you to quickly change the appearance of the output document and enforces a uniform look across the company.

Numbering headings for Microsoft Word

Use a style sheet with numbered headings to obtain headings numbered as a hierarchical list.

Unicode data in output

All Unicode data is rendered if the font that is used supports Unicode.
  • For PDF output, additional configuration is necessary. See the PDF output settings for details. If you used a non-Unicode font, generate the document again using True Type Unicode fonts and set the appropriate output properties.
  • For Microsoft Word output, if you used a non-Unicode font, change the font in the output document after document generation.
  • For HTML output, if you used a non-Unicode font, change the font family in the style sheet after document generation.

OLE objects

You can extract embedded objects, such as Object linking and embedding (OLE objects), from a Rational DOORS® data source. OLE objects are always rendered as images in HTML, PDF, and XSL-FO outputs, because those formats do not support OLE objects.

For Microsoft Word output, you must set the OLEs as static images property in the metadata section of the document specification.
  • If the OLEs as static images property is set to true, OLE objects are included in the output document as static images.
  • If the OLEs as static images property is set to false, a ref folder is generated in the same location as the Microsoft Word output document.
The ref folder contains .rtf files for the OLE objects. For each OLE object exported, the Microsoft Word output has one included field pointing to an .rtf file. Because IBM® Rational Publishing Engine cannot update Microsoft Word fields, the included fields are not visible when the Microsoft Word document is open. To make the fields visible, take one of the following actions:
Action Result
Select the entire document content and use the Update fields function in Word. The OLE objects are displayed in the document. The document is not self-contained.
Use the updateFields macro provided by Rational Publishing Engine. The OLE objects are displayed in the document. The document is not self-contained.
Use the insertOLEs macro provided by Rational Publishing Engine. The OLE objects are displayed in the document. The document is self-contained.
Use the rpe or insertOLEs macros provided by Rational Publishing Engine. The OLE objects are displayed in the document. The document is self-contained.
Note: If you move a document that is not self-contained to another computer, you cannot edit the OLE objects. To prevent this problem, run the rpe or insertOLEs macros.

Feedback