c# - Microsoft Office 文档显示 Sharepoint URL 而不是本地

标签 c# sharepoint office-interop onedrive

情况:OneDrive for Business 将文件从 Sharepoint 站点文档库同步到本地目录:

C:\Users\users\Sharepoint\Library\Test.pttx

但是使用 PowerPoint InterOp 时:

presentation.Path

是:

https://company.sharepoint.com/Library/Shared%20Documents/

Sharepoint 的正确路径是什么。

如何访问本地目录?

更新:我找到了一个 similar question在 MSDN 上但没有答案

最佳答案

根据这个post ,可以在这个多字符串注册表值中查找已同步的文件夹:

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common \Internet\LocalSyncClientDiskLocation

鉴于您的本地路径和 SharePoint URL 看起来像

C:\Users\User\SharePoint\Library - Documents\Folder\SubFolder\Document.pptxhttps://***.sharepoint.com/Library/Shared%20Documents/Folder/SubFolder/Document.pptx,

您可以尝试从 URL 中提取本地部分 Folder/SubFolder/Document.pptx,将其添加到从注册表值检索的本地文件夹路径中并检查文件是否存在。

关于c# - Microsoft Office 文档显示 Sharepoint URL 而不是本地,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27353322/

相关文章:

c# - 将具有 C++ 引用成员的 C# 类编码

c# - 如何通过 ASP.NET API 使用 SQL Azure 数据库?

c# - 如果在 Android 中安装了特定的应用程序,我如何从 Xamarin 中找出?

html - 如何使用CSS旋转文本?当前架构不支持转换?

sharepoint - 如何更改 SharePoint 扩展 Web 应用程序的 web.config 文件

visual-studio - 更改为 SharePoint 后自动上传 Typescript 文件

visual-studio-2010 - 哪个 Microsoft.Office.Interop.Outlook 版本可与 Outlook 2003 配合使用?

c# - 动态调用<T>对象类

c# - 包含来自 SSRS 报告的多个工作表的 Excel 文件

asp.net - ApplicationClass Documents.Open 为 64 位系统上的 ASP.NET 站点返回 null