The goal is to Read a .docx file with generic (built-in) styles and write a copy with custom styles preserving the original content (i.e., map one paragraph-level style to another).
Word comes with built-in styles like Normal, Heading 1, and List Bullet.
Custom style definitions are stored in the styles.xml part of a .docx file package, whereas built-in style definitions are stored in the Word application itself and are not written to styles.xml until they are actually used.
Let's take a document that utilizes built-in styles and:
[x] create custom styles,
[x] create a (to/from) style map, and
[x] create a new version of the original document, but with custom styles.
The challenge will be to preserve character styles (e.g., bold and italics), which are different from paragraph styles.
The goal is to Read a .docx file with generic (built-in) styles and write a copy with custom styles preserving the original content (i.e., map one paragraph-level style to another).
Word comes with built-in styles like
Normal
,Heading 1
, andList Bullet
. Custom style definitions are stored in thestyles.xml
part of a .docx
file package, whereas built-in style definitions are stored in the Word application itself and are not written to styles.xml until they are actually used.Let's take a document that utilizes built-in styles and:
The challenge will be to preserve character styles (e.g., bold and italics), which are different from paragraph styles.