简体   繁体   English

如何使用C#在Office 365 / OneDrive for Business中创建Word文档

[英]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.

相关问题 使用C#访问OneDrive For Business(Office365) - 无法列出子文件夹 - Using C# to access OneDrive For Business (Office365) - Can't list subfolders 如何在 C# 中使用 office 365 API 创建群组邮件别名 - How can I create group mail alias using office 365 API in C# 使用Office 365 Iframe上的C#访问word文档 - Access word Document using C# on premises show on Office 365 Iframe 为什么我不能使用C#VSTO从Word文档中复制带有365的图像(空引用异常)? - Why can I not copy images from Word document with Word 365 using C# VSTO (null ref exception)? 如何在C#中使用CreateObject打开Word文档? - How can I open a word document by using CreateObject in C#? 如何将整个datagridview导出成word文档(在C#中使用office word interop DLL) - How to export the entire datagridview into a word document (using office word interop DLL in C#) 如何使用Microsoft.Office.Interop.Word C#在Word文档中插入/获取封面 - How to insert/fetch a cover page in word document using Microsoft.Office.Interop.Word C# 如何使用OneDrive SDK更新存储在OneDrive(业务)上的文件的创建和/或最后修改时间 - How can I update the creation and/or the last modified time of a file stored on OneDrive (Business) using the OneDrive SDK 如何使用 c# 检查 Office 365 中是否存在日历事件? - How to check calendar event exist or not in office 365 using c#? 如何使用C#编辑全局地址列表Office 365 - How to edit Global Address List office 365 using c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM