Office 365 - Create *.docx | *.pptx | *.xlsx Files
Solution 1:
"Empty" Office files aren't really 0 byte files. The desktop Office applications (except Excel) are able to take a 0 byte file and make it become an Office document (insert the "template" that makes a file an Office file). The online Office apps currently don't support doing that.
As there is no API currently to create a new file of a particular type, you'll need to work around it. To do this, you need to store and upload "template" files for Word, Excel, and PowerPoint. The example you provided is one way of doing this for Word, where you've created an empty HTML page and uploaded it.
For Excel and PowerPoint, you would need to do something similar by creating an empty file and uploading that as the "new" file whenever your app wants to create a new empty file. However, instead of being able to store a simple HTML string as the template file content, you'll need the actual binary content of a new file, which can be up to ~30kb depending on the type.
We are working to improve the Web apps so they can take a 0 byte file and "convert" it into a new document, but that is still a bug today.
Post a Comment for "Office 365 - Create *.docx | *.pptx | *.xlsx Files"