FME Version
Files
-
- 30 KB
- Download
Introduction
The Microsoft Word Styles are built-in and predefined combinations of formatting that you can apply to text to quickly change its appearance. Word has many built-in Styles but those only exist in the Microsoft Word application and are not added to documents by default. A style is added to the document once the style is used at least once and saved. By default, a document created with the ‘Blank Document’ template through Microsoft Word contains no styling.The default template the Microsoft Word writer uses has many predefined Word styles which correspond to the drop-down list for the Style parameter in the MSWordStyler transformer. To use built-in Word styles, you must download and make any further modifications required to the base file (default.docx) attached in the Files section.
If a custom base Word file with no styling is specified in the Word writer via the Base Microsoft Word File writer parameter, a warning will be logged and styles specified in the MSWordStyler will not appear in the output Word document.
This article will guide you through creating a Microsoft Word base file with styles as well as modifying an existing style to the base file.
Step-by-Step Instructions
1. Download Word Base FileDownload a copy of the base file template default.docx (see Files section above). This base file contains all the required styles to allow the MSWordStyler to style features and write them out to a document with the Microsoft Word Writer.
2. Modify an Existing Style
Open the downloaded base file template in Microsoft Word. Select an existing style and modify it. For this example, we will modify the style named Heading 1.
Right-click on the Heading 1 style in the Home tab of Microsoft Word's ribbon and select Modify... from the drop-down menu
Change the font color from the default blue to orange. Click OK to save the change to this style.
Change the font color of Heading 1 style from blue to orange and click OK to accept this change
3. Save the Modified Base Document
Save the Word document with the modified Heading 1 style and close it. You should now be able to use this base word file in the Word writer's Base Microsoft Word file parameter in FME.
Specify the modified base file in the Microsoft Word writer's Base Microsoft Word file parameter
Any header text that has the Heading 1 style applied using the MSWordStyler will now use your defined style (orange font color for this example) in the output Word file.
Output file created from the modified base Word document showing orange color for heading 1 text
Note that it is also possible to modify other characteristics of the document (i.e headings, fonts, colors, page orientation, etc.) instead of just existing text styles as shown in this example.
Comments
0 comments
Please sign in to leave a comment.