Specifying a Custom Template File
If you want users to use a Word template file other than that shipped with Arbortext Import/Export, create the template file, save the template file from Word in RTF format, and copy the RTF template to the Arbortext Publishing Engine server. From each client workstation, run Arbortext Styler, choose > , and navigate to the RTF tab. Browse to or enter the path and file name of the RTF template in the Template File field. Users may override this setting by changing or deleting the value in this field.
If no template file is specified, only the Word styles defined in Arbortext-path\lib\importexport\lib\word-builtin-styles.rtf will be used for RTF formatting.
|
Be aware of the following items:
• During stylesheet development using Arbortext Styler, this file name is a fully-qualified path name, which may not be valid on the Arbortext Publishing Engine server when the stylesheet is deployed. In this case, the Arbortext Publishing Engine will search the value of the importexportpath Advanced Preference for the first-found instance of the user-defined RTF template file, using the base name of the file.
• Arbortext Import uses an RTF version of the Word template file . If a .dot template file is updated, the .dot file must be re-saved as a .rtf file.
|
If you wish to include the user-defined style names in the style name lists of the RTF property category, you can create a custom version of word-builtin-styles.xml. To create the desired XML markup for word-builtin-styles.xml, consider using the following VBA macro to extract style names from any Word document or template and create the desired markup for paragraph and character styles. You will then need to extract the list paragraph styles from the <ParagraphStyles> list and add level attribute to indicate nesting level.
Sub PrintAllBuiltinStyles()
'
' Loop through the builtin styles
' and print the rtf-fields.xml markup
' to the "Immediate Window"
'
'
Dim aStyle As Style
Dim aStyles As Styles
Set aStyles = ActiveDocument.Styles
Debug.Print "<ParagraphStyles>"
For Each aStyle In aStyles
If aStyle.BuiltIn = True Then
If aStyle.Type = wdStyleTypeParagraph Then
Debug.Print "<StyleName>" + aStyle.NameLocal + "</StyleName>"
End If
End If
Next
Debug.Print "</ParagraphStyles>"
Debug.Print "<CharacterStyles>"
For Each aStyle In aStyles
If aStyle.BuiltIn = True Then
If aStyle.Type = wdStyleTypeCharacter Then
Debug.Print "<StyleName>" + aStyle.NameLocal + "</StyleName>"
End If
End If
Next
Debug.Print "</CharacterStyles>"
End Sub
Sub PrintAllUserDefinedStyles()
'
' Loop through the builtin styles
' and print the rtf-fields.xml markup
' to the "Immediate Window"
'
'
Dim aStyle As Style
Dim aStyles As Styles
Set aStyles = ActiveDocument.Styles
Debug.Print "<ParagraphStyles>"
For Each aStyle In aStyles
If aStyle.BuiltIn = False Then
If aStyle.Type = wdStyleTypeParagraph Then
Debug.Print "<StyleName>" + aStyle.NameLocal + "</StyleName>"
End If
End If
Next
Debug.Print "</ParagraphStyles>"
Debug.Print "<CharacterStyles>"
For Each aStyle In aStyles
If aStyle.BuiltIn = False Then
If aStyle.Type = wdStyleTypeCharacter Then
Debug.Print "<StyleName>" + aStyle.NameLocal + "</StyleName>"
End If
End If
Next
Debug.Print "</CharacterStyles>"
End Sub