attribute description bold the text appears in bold italic the text appears in italic underline the text is underlined strike the text appears with strikethrough double_strike the text appears with double strikethrough all_caps the text appears in capital letters small_caps the text appears in capital letterswith lowercase letters two points smaller shadow the text appears with shadow outline the text appears outlined rather than solid rtl the text is written right-to-left imprint the text appears pressed into the page emboss the text appears raised off the page in relief for exampleto change the styles of demo docxenter the following into the interactive shellimport docx doc docx document('demo docx'doc paragraphs[ text 'document titledoc paragraphs[ style the exact id may be different_paragraphstyle('title'id doc paragraphs[ style 'normaldoc paragraphs[ text ' plain paragraph with some bold and some italic(doc paragraphs[ runs[ textdoc paragraphs[ runs[ textdoc paragraphs[ runs[ textdoc paragraphs[ runs[ text(' plain paragraph with some ''bold'and some ''italic'doc paragraphs[ runs[ style 'quotechardoc paragraphs[ runs[ underline true doc paragraphs[ runs[ underline true doc save('restyled docx'herewe use the text and style attributes to easily see what' in the paragraphs in our document we can see that it' simple to divide paragraph into runs and access each run individually so we get the firstsecondand fourth runs in the second paragraphstyle each runand save the results to new document the words document title at the top of restyled docx will have the normal style instead of the title stylethe run object for the text plain paragraph with some will have the quotechar styleand the two run objects for the words bold working with pdf and word documents