2
votes

I have a WebDAV-Server that provides resources like e.g. Office-Documents.

Our small web client provides the possibility to open and edit this documents by using the office URI scheme (e.g. ms-word:ofe).

For example when you click on a link ms-word:ofe|u|[domain]/[pathtofile] Microsoft Word opens the requested document and the user is able to edit, save and so on. Works fine on Windows Desktop.

Now I tried to use the same link in Safari on an iPad to open the document in the installed word app. The browser requests to open this file in this application. The app starts but aborts opening the document by an error-message Cannot Connect to URL. Please use a valid URL.

Some weird facts: I tried to open a Document thats located on an other WebDAV-Server. The hyperlink ms-word:ofe|u|[DOMAIN]/Pers%C3%B6nlich/doc.docx works. But when I rename the folder the file is located to ms-word:ofe|u|[DOMAIN]/Pers%C3%B6nlich**e**/doc.docx the app aborts with some other error-message.

Now I'm confused and need help with it ;)

Thanks for any hint!

1
What would interest me is what you return for the initial OPTIONS request. For us, the app consistently fails after checking OPTIONS. For you it seems more an encoding problem. We had an issue similar to that between Chrome and Word on the Mac. Chrome for Mac does not like the pipes in |u| and needs that part to be url-encoded as %7Cu%7C.Berend Engelbrecht

1 Answers

2
votes

It's not possible to do that.

For the ms-word url scheme to work, the document must live in SharePoint or OneDrive, stated here

You can enable users who are running Office on an iOS device to open and edit files stored in SharePoint or OneDrive from any application, and then quickly return them to the original application when they’re done editing the file.

The closest thing to what you want to do would be to create a UIDocumentInteractionController. However this would only allow your users to use the document in read-only mode, but they can duplicate it to edit it. That duplication will only be available inside ms word.

AND UIDocumentInteractionControllers only work for local file paths, so you would first have to store that document from your server onto the phone, then open it from the phone using the documentInteractionControlller, then, if you want, delete it from the phone so that there's no used up memory left over.