Links

Convert to HMTL

Tags: #microsoftword #word #microsoft #html #snippet #operations
Author: Jeremy Ravenel​

Input

Import library

try:
import mammoth
except:
!pip install mammoth
import mammoth

Model

Reading file and converting

with open("naas.docx", "rb") as docx_file:
result = mammoth.convert_to_html(docx_file)
html = result.value # The generated HTML
messages = result.messages # Any messages, such as warnings during conversion

Output

Converted

html