Saving a Shared Docx from Onedrive To Original Onedrive Location in MS Word

守給你的承諾、 提交于 2019-12-10 11:26:57

问题


I was wondering if someone could help me with a problem I'm having integrating Onedrive with MS Word.

I’m working on a C# MVC web application that uploads a document from our system to onedrive using the Live SDK, then uses the MS Word URI scheme to open the document in word for mac or pc.

E.g. ms- word:ofe|u|https://d.docs.live.net/a2127392r369g83a/FOLDER_NAME/FILE_NAME

(MS Word URI schema: https://msdn.microsoft.com/en-us/library/office/dn906146.aspx)

Under normal conditions this works fine, and allows the document to be opened in word. The user can edit the doc, click save, and it will be saved to the user’s Onedrive path given in the URI (assuming the user has signed into the same MS Live account in Word, that is connected to our application).

However there are occasions where someone might not log in to the same account that is registered with our application, or are sometimes not prompted to enter a password, and so they sit there forever wondering why they can’t open the document (this has happened occasionally when a user has saved a password from a different Live account onto their mac keychain).

We have tried using edit links or pre-authenticated urls to get around this. Unfortunately there are problems with saving the document to the original location, regardless of the method used. For example, obtaining a shared_edit_link will allow you to open the document in word online, which can allow you to sign in to a different account and save to the original location online or via MS word. However opening in word online often defeats the purpose, as in most circumstances the account linked to our application will be logged into automatically unless the user clears cookies or uses incognito, so clicking "Open in Word" will still require the user to log into the original account.

To sum up the problem, we basically need a way to open a document in edit mode directly in Microsoft Word, that will also allow us to save the document to the original Onedrive location.

Has anyone ever been able to accomplish this, or knows of a better way?

来源:https://stackoverflow.com/questions/31195891/saving-a-shared-docx-from-onedrive-to-original-onedrive-location-in-ms-word

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!