Relative Content

Tag Archive for python-docx

Issue with changing fonts for different styles using python-docx

I am trying to change font styling of a document as per the user’s input preferences. Eg, if a user inputs to use font Bell MT for style Normal, Helvetica for Heading 1, Bahnschrift for Heading 2 etc and their specific sizes, colour and alignment. I tried the following code but it only changed styles for Normal and not for Heading 1 and 2.

Having trouble iteratively reading from Word document and adding to an excel file

Working on a way to read from a Word document and export contents to Excel. I have tried creating a list in Python and then appending the text that I read to the list, but I keep getting error: AttributeError: ‘str’ object has no attribute ‘append’. I read the python-docx help files and have not found anything that helps me.