19

Let's suppose that I have WebDAV-enabled server, where I have bunch of Office documents. I'd like to generate webpage which has link to document such that clicking on the link will open Microsoft Word. Word will in turn download document from WebDAV server, and when user finishes editing document, MS Word will upload it back.

I know that MS Word (and other Office programs) support editing of documents stored on WebDAV server. What I don't know, is how to generate link which will trigger MS Word to download this document by itself.

Is it possible? Maybe using some special scheme?

2
  • can you check if the answer by gciochina should be the selected answer - this is how for example Firefox works in Sharepoint when a link is opened. Dec 16, 2016 at 11:48
  • Nowadays I guess you'd instead look at Word Online or NativeDocuments. Oct 16, 2018 at 1:30

4 Answers 4

65

Ummm, you could also use something like this:

<a href="ms-word:ofe|u|http://some_WebDav_enabled_address.com/some_Word_document.docx">Open Document in Word</a>

The difference from the above answers is that this would no longer require ActiveX and it will work at least in IE 8+, Chrome and Firefox, as long as it is opened from a Windows machine, for Office 2010+ (not 100% sure about this one though).

Explanation: the ms-word:ofe part is a protocol that gets installed on the client machine when Office is installed. I don't know exactly what the |u| part does.

5
  • 6
    This is the only sensible solution nowadays and should be the accepted answer. The u is the argument descriptor btw and contains further information about the command (ofe - 'open for edit' in this case). As far as I know it is always u, though.
    – bstenzel
    Mar 4, 2016 at 13:19
  • 11
    It's documented here: msdn.microsoft.com/en-us/library/office/dn906146.aspx Mar 10, 2017 at 0:15
  • 1
    Here is an up-to-date documentation on URL schemes for invoking MS Office apps: wopi.readthedocs.io/projects/officewopi/en/latest/scenarios/…
    – Alex Klaus
    Feb 15, 2018 at 4:53
  • Thanks for the answer. How to open two word documents using the same "href"?
    – Sathish
    Feb 28, 2019 at 11:42
  • The "ofe" - edit part of the URI schemes seems to no longer work. It's always opened in view only mode now.
    – marvc1
    Dec 14, 2022 at 17:18
11

Confluence uses the EditDocument method of the SharePoint.OpenDocuments ActiveX control.

Example in Javascript:

new ActiveXObject("SharePoint.OpenDocuments.1").EditDocument("http://example.com/test.doc")
1
  • 4
    any idea how to use thin in FF or Chrome? Dec 27, 2012 at 19:29
6

As far as I recall, the only way to achieve this is to explicitly instantiate Word through ActiveX, and the pass it the URL to open.

This can be done inside the HTML page (in which it'll need IE), or using an external application that then would need to be registered for a new mime type (see http://greenbytes.de/tech/webdav/rfc4709.html#rfc.section.B.1 for an example).

2
  • Julian, as a spec author, you probably know if there are any clients supporting Mounting Webdav Servers out of the box? Mar 23, 2009 at 15:28
  • 1
    The Xythos client does. And the spec already contains the code to make it happen with the Microsoft webfolder client, It would be nice to have a matching implementation for MacOS X; shouldn't be too hard... Mar 24, 2009 at 7:44
0

I found that Confluence can do this. They have special Firefox plugin, but it should work fine with Internet Explorer.

In fact, when I started to play with it, it turned out that IE does actually opening document directly from WebDAV. It seems like if IE downloaded the page, passed it to MS Word, but together with URL. MS Word can then save file back (well, sometimes it sees the file as read-only, and doesn't allow to save back, but allows to upload under different name).

Still investigating.

2
  • When you say "sometimes it sees the file as read-only" did you get anywhere on this? I've posted another question on a similar issue: stackoverflow.com/questions/2999450/…
    – rjmunro
    Jun 9, 2010 at 13:59
  • @rjmunro: unfortunately no ... we didn't use ActiveX/plugins technique for opening MS Word after all. Jun 9, 2010 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.