Reputation: 206
I want to create a word document with some content in it into Office 365/'OneDrive for Business' suing Asp.net MVC and C#, how can I achieve the same?
Upvotes: 1
Views: 2091
Reputation: 619
It looks like you have two different tasks you want to achieve here - first, creating a docx file programmatically, then second, uploading that file to Office 365.
The first part - how to create a docx file - can be done in several different ways. Do you just want to create a blank file? If so, you could just script the file creation (touch myfile.docx
or whatnot) -- and then you are done. Want to create a document with content? My suggestion then would be to read up on the Open XML SDKs, which allow developers to manually assemble docx files. There is a fair amount of documentation on this on MSDN, as well as openxmldeveloper.org.
Once you have the file, you can upload it to Office 365 using the Office 365 Files APIs. The 365 APIs have C# client libraries, which you can use to upload the file.
Upvotes: 1