Skip to content

Issue while adding new header to the existing document, if convert doc to docx using LibrOffice #656

@swagat123

Description

@swagat123

Hi

Adding new header worked fine for docx . We recently got "doc" file and i used the LibreOffice to convert doc to docx. I tried to add a header in this document , it throws error message
document = Document("myfile.docx")
document.add_heading('Heading, level 2', level=2)
document.save("myfile.docx")
KeyError: "no style with name 'Heading 2'"

Is this library not supporting to add the heading if the doc is converted using LibrOffcie?

I appreciate your suggetsions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions