privateOmega / html-to-docx

HTML to DOCX converter
MIT License
375 stars 141 forks source link

Can't open file in Microsoft Word #195

Open ohitsdoh opened 1 year ago

ohitsdoh commented 1 year ago

Tried this on both Windows and Mac, getting the same error. image

I did try to open it in both LibreOffice and Pages -- both work, but not in Word.

privateOmega commented 1 year ago

@ohitsdoh Could you please attach the code you used to generate it with the html?

musmanfaisal commented 11 months ago

The same issue is happening for me as well It opens in any other software but not in word

grin commented 10 months ago

In my case it was the same problem as described in: https://github.com/privateOmega/html-to-docx/issues/57#issuecomment-794646955 and adding missing margin params fixed it

trinhphong commented 5 months ago

I have same issue that cannot open the doc/docx file with MS Word (only MS Word)

const docxDocument = await HTMLtoDOCX(
   '<!doctype html><html><head></head><body>' + dataReplaced + '</body></html>'
);

dataReplaced is a html string. Please help me out.