Microsoft Office document shows Sharepoint URL instead of Local

Situation: OneDrive for Business is syncing files from a SharePoint site document library with a local directory:

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

However, with PowerPoint InterOp:

presentation.Path

There is:

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

What is the right way for Sharepoint.

How to access the local directory?

Update: I found a similar question on MSDN, but did not answer

+4
source share
2 answers

According to this message, synchronized folders can be found in this registry value with several lines:

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

Given that your local path and the SharePoint URL look like

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

Folder/SubFolder/Document.pptx URL-, , , .

+2

, , Powerpoint (VSTO) Sync'd? Powerpoint, presentation.GetLocalPath()?

, ( MSDN ), MSG CSG , .

, , impossble. Word OneDrive "Offline" - OneDrive, Word Application (Word Application , OneDrive), , , "http:/d.docs.live.net/xxxx/xx.docx" "C:\XXX\XXX".

, , SharePoint . , PowerPoint Interop , .

1). , , - OneDrive - ( ProcessMonitor), , , .

2) , https://company.sharepoint.com/Library/Shared%20Documents/LocalDrivePath.txt, () WebClient .

enter image description here

:

public string GetLocalPath(this Microsoft.Office.Interop.PowerPoint.Presentation presentation)
{
    WebClient client = new WebClient();
    string localPath = client.DownloadString(presentation.Path + "LocalDrivePath.txt");

    //Some good old protective programming to quickly identify the problem if the file doesn't exist
    if (!string.IsNullOrEmpty(localPath)) throw new Exception("Issue: LocalDrivePath.txt not found in " + presentation.Path + Environment.Newline + "Please add the file for this Office Documents' sync'd (offline) local folder to be identified.");

    return localPath;
}

:

presentation.GetLocalPath();
+2

All Articles