2017-03-21 127 views
1

Microsoft Office注册多个协议处理程序,如ms-word,ms-excel等。有限文档可用here。我试图使用Excel协议处理程序打开一个文件传递给它一个文件uri而没有多少运气。我可以在没有问题的情况下使用http/https uri进行操作,但是在我的情况下,文档驻留在网络文件共享中。Office协议处理程序

这工作,如果该文件是一个Web服务器上:
ms-excel:ofv|u|http://someserver/somefolder/document.xlsx

这不起作用:
ms-excel:ofv|u|file://someserver/somefolder/document.xlsx

我收到以下错误:

The action couldn't be performed because Office doesn't recognize the command it was given.

是有什么办法可以使这些协议处理程序使用文件URI?

+0

该文件URI来自哪里?它看起来不正确。 UrlCreateFromPath将\\ someserver \ somefolder \ document.xlsx转换为file://someserver/somefolder/document.xlsx – Anders

+0

@Anders我在原来的文件uri中有额外的斜线。我已经更新了该问题以删除它们。 – codechurn

+0

你如何执行? ShellExecute的?点击浏览器中的链接?的SharePoint? – Anders

回答

-1

尝试ms-excel:ofv|u|file://(Your IP Address or any address)/somefolder/document.xlsx

+0

正如我的问题所述,这是行不通的。 – codechurn