Inx51
Inx51

Reputation: 2101

Create new word document based on template from browser/javascript

I'm looking for a way to create/open a new word document based on a selected template (dotx) using a browser/javascript.

Basically what I want to achive is the same functionality thats in sharepoint where you can from a menu create a new document based of a template.

Create document based on template from within sharepoint

Any ideas of where to start? I have been googling for a solution but all I could find was how to do this if your javascript is running in the same context as sharepoint. However, I would like to do this outside of the context of sharepoint, but its fine if I need to add a few libraries to my site to be able to support this kind of functionality.

Upvotes: 0

Views: 1282

Answers (1)

Inx51
Inx51

Reputation: 2101

Turns out that office has support for some uris that can be used for this case.. for instance: ms-word:nft|u|{address to dotx-file} would create a link that opens up a new word document based on the target template. More regarding the uris can be found here: https://learn.microsoft.com/en-us/office/client-developer/office-uri-schemes

Upvotes: 2

Related Questions