Cil*_*vic 5 c# sharepoint office-interop onedrive
情况:OneDrive for Business 将文件从 Sharepoint 站点文档库同步到本地目录:
C:\Users\users\Sharepoint\Library\Test.pttx
Run Code Online (Sandbox Code Playgroud)
然而,对于 PowerPoint InterOp:
presentation.Path
Run Code Online (Sandbox Code Playgroud)
是:
https://company.sharepoint.com/Library/Shared%20Documents/
Run Code Online (Sandbox Code Playgroud)
这是 Sharepoint 的正确路径。
如何访问本地目录?
更新:我在MSDN上发现了类似的问题,但没有答案
根据这篇文章,可以在这个多字符串注册表值中查找同步文件夹:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common
\Internet\LocalSyncClientDiskLocation
鉴于您的本地路径和 SharePoint URL 如下所示
C:\Users\User\SharePoint\Library - Documents\Folder\SubFolder\Document.pptx和
https://***.sharepoint.com/Library/Shared%20Documents/Folder/SubFolder/Document.pptx,
Folder/SubFolder/Document.pptx您可以尝试从 URL 中提取本地部分,将其添加到从注册表值检索的本地文件夹路径中,然后检查文件是否存在。