将 html 内容保存为 ms word 打不开的 docx 格式

Save html content as docx format which is not opening in ms word

我想用 python 代码使用 html 内容创建一个 docx 文件。我直接写入扩展名为 .docx 的文件。 这是在 Libre Office 中打开的,但不幸的是在 MS Word 中它没有打开。它显示为损坏的格式。为什么会这样?

我错了。 MS word 不支持 .docx 格式。而是使用在两个应用程序中都支持的 .doc 格式!!!