[英]How can I create a Word document in office 365 / 'OneDrive for Business' using c#
我想使用Asp.net MVC和C#在Office 365 /'OneDrive for Business'中创建一个包含某些内容的Word文档,如何实现相同的目的?
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. 看来您要在此处完成两个不同的任务-首先,以编程方式创建docx文件,然后将其上传到Office 365。
The first part - how to create a docx file - can be done in several different ways. 第一部分-如何创建docx文件-可以通过几种不同的方式来完成。 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. 如果是这样,您只需编写文件创建脚本(
touch myfile.docx
或诸如此类),就可以完成。 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.
然后,我的建议是阅读Open XML SDK,这些SDK允许开发人员手动组装docx文件。 There is a fair amount of documentation on this on MSDN , as well as openxmldeveloper.org .
在MSDN以及openxmldeveloper.org上有大量与此相关的文档。
Once you have the file, you can upload it to Office 365 using the Office 365 Files APIs . 拥有文件后,可以使用Office 365文件API将其上传到Office 365。 The 365 APIs have C# client libraries , which you can use to upload the file.
365 API具有C#客户端库 ,您可以使用它们来上传文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.