简体   繁体   English

如何使用C#以编程方式打开服务器上的Office文件?

[英]How to programmatically open an Office file locate on a Server with c#?

i have a VSTO application(WPF) which can save an opened Excel File on a IIS Server(WCF). 我有一个VSTO应用程序(WPF),可以将打开的Excel文件保存在IIS服务器(WCF)上。 I'm planning to use it on different PCs. 我打算在不同的PC上使用它。 So i'm trying to implement a function that open a file located on this Server. 因此,我正在尝试实现打开位于此服务器上的文件的功能。 But it seems very difficult to be! 但是似乎很难!

I think you can do it in that way. 我想你可以那样做。 Get the file content from the server as string or byte and save it to some temporary location. 从服务器以字符串或字节的形式获取文件内容,并将其保存到某个临时位置。 The you can use the Workbooks.Open method http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.open.aspx 您可以使用Workbooks.Open方法http://msdn.microsoft.com/zh-cn/library/microsoft.office.interop.excel.workbooks.open.aspx

[EDIT] I have found something useful for you I think. [编辑]我发现了一些对您有用的东西。 Take a look at this Managing Documents on a Server by Using the ServerDocument Class 看看使用ServerDocument类在服务器上管理文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何在Office Word 2013中打开.pdf文件(在C#中)并将其另存为.docx(在C#中的代码)? - how can i open .pdf file in office word 2013(in c#) and save as it in .docx (code in c#)? 如何在C#中使用EnvDTE以编程方式打开文件 - How to open file programmatically using EnvDTE in C# 如何在不使用C#安装MS Office的情况下以编程方式读取MS Access数据库文件 - How to read ms access database file programmatically without installing ms office in c# 以编程方式打开zip文件菜单C# - Programmatically open zip file menu C# C# 在上下文菜单上以编程方式“打开”文件 - C# Programmatically “Open” on Context Menu a file C# - 如何以编程方式添加Excel工作表 - Office XP / 2003 - C# - How to add an Excel Worksheet programmatically - Office XP / 2003 如何以编程方式将.MDF文件附加到Azure SQL Server C# - How to attach .MDF file to Azure SQL Server programmatically c# 如何通过 Office.Interop.Excel C# 打开 excel 文件的流或 base64 - How open stream or base64 of excel file by Office.Interop.Excel C# 如何在C#中以编程方式打开Microsoft Infopath? - How to programmatically open Microsoft Infopath in C#? 如何将datagridview导出到Open Office Excel C# - How to export datagridview into Open Office Excel c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM