DEV Community

Discussion on: How does one create MS Office documents programmatically?

Collapse
 
unstuckdev profile image
The Unstuck Developer

There's the theory and then there's the practice. In theory, the format is open and documented. It's a simple zip file with some XML inside. In practice, Word has to deal with decades of legacy expectations that are baked into the software that typically generates them.

Libraries exist to generate Word files in JavaScript, though I can't vouch for any. Whether or not the output works consistently in all software that reads them is another matter.

Collapse
 
derekjhopper profile image
Derek Hopper

Great point. This has been my experience as well. We once generated a file that could be read by Numbers.app and Excel; however, couldn't be read by a piece of third party software.