HTML

For HTML output, create the template file in Word (.docx).

*Please check the Template Common Settings before referring to this page.

*This feature is available in Office File Creator Pro.

Formatting of Merge Fields

For formatting Date, Date/Time, Currency, and Number fields, refer to the following.

Formatting of Date and Date/Time Fields

Formatting of Currency and Number Fields

 

Line Spacing

Uncheck "Snap to grid when document grid is defined" under Paragraph > Indents and Spacing in the Word template file. When checked, the line spacing is quite wide in the output.

  • Select all existing contents in the template with "Ctrl+A" and clear the check box in the Paragraph dialog.
  • Clear the check box in the Paragraph dialog for each style you use, such as the Normal style.

 

Tables

Borders

  • If table borders are not output, set the borders again from the Table Properties. On the Word template, the borders of adjacent cells are displayed and the borders of the target cell may not be set.

 

Cell Size

From Table Properties > Table tab > Options, uncheck "Automatically resize to fit contents".

 

Consideration

  • If the layout is broken after copying a table from another application, create a new table inside the Word template.
  • For different layouts on the left and right sides, create a single table and set it up by dividing cells and displaying/hiding table borders. Tables cannot be placed side by side, nor can text be displayed next to a table.

 

Layout Example

Layout Example (cell division, showing/hiding borders)

 

Striped Layout

To output a child object table with alternating row colors, set two rows of child object merge fields. For the second row, set the same merge fields as in the first row.

 

Font

  • If Word's font settings specify fonts for multiple languages, the Latin text font is applied.
  • If the font used in the Word template is not installed on the viewer's computer, the font specified in the "HTML Fallback Font Style" field of the OFC_Template record is applied.

 

Images

  • Template files can include images such as company logos.
  • Objects such as shapes and text boxes are not supported. Right-click on the object and select "Save as Picture" to save it as an image and replace the object with an image.
  • Images cannot be output over text.

 

Header/Footer

  • Only a single line of text can be output in headers and footers. Text spanning two or more lines is not supported.
  • Images cannot be used in headers or footers.
  • Headers and footers are supported in Chromium-based browsers such as Chrome and Microsoft Edge. Other browsers, such as Safari and Firefox, are not supported.

 

Page Number/Page Count

Use the following merge fields in the footer or header for page numbers and the total number of pages. In the preview, the page number and total page count are shown as "#"; the actual page number and total page count appear in the print view.

Page Number: {!pagenumber()}

Page Count: {!pagecount()}

 

e.g. Display as page number / total page count

{!pagenumber()} / {!pagecount()}

 

Template Sample

 

Download Sample Template Files

 

Limitations

  • HTML supports preview and printing from the browser only. Downloading and saving the file to Salesforce are not supported.
  • Spacing created with tabs in Word is not supported.
  • If the layout is broken after copying a table from another application, create a new table inside the Word template.
  • Tables cannot be placed side by side, nor can text be displayed next to a table. For different layouts on the left and right sides, create a single table and set it up by dividing cells and displaying/hiding table borders.
  • User-defined characters (gaiji) are not supported.
  • Office features such as objects (text boxes, shapes, etc.), field codes, and watermarks are not supported.
  • Images cannot be output over text.

 

Reference

Template Common Settings

HTML Preview

 

Troubleshooting