views:

406

answers:

2

Can someone explain this strange (or normal) behaviour: I've got an Webdav directory. In this folder, I have a word document, called document.doc.

When I open Word, en then choose to open file, and fill in the whole URL (http://server/webdav/document.doc), Word will open the document just fine. Changes I make are being saved on save click.

Now, when i make a HTML page with an anchor to this document like this:

<a href="http://server/webdav/document.doc"&gt;Edit document</a>

It will open the document just fine, but in read only modus!

Investigation learned that when you use Word to open the file, it will also function as WebDav client. So it will send the appropriate headers to lock the file etc.

Calling it from an anchor, lets your browser do the GET. Then it will pass the document (downloaded??) to Word. Word does some HTTP calls on the file, but no LOCK and so.

Does anyone have any idea how I can solve this? I could write some PHP code to do the HTTP calls and so, but how do I get it in Word then?

+2  A: 

I wouldn't expect this to be possible. When you open it through your web-browser, you're first downloading a copy that's then stored in a temp folder and then handed to word. What you're looking for is having word open the document. Hence, what you would need to do is have the link open up word and pass it a parameter. A very nasty hack would be to have php generate files readable by word that make it open the desired webdav-document. You could do this with macros, but a) you'd need to lower your macro security settings in word and b) you'd never be able to rely on others having done this (hence, it's just a solution for you).

Fake51
A: 

See this question. Basically you use a bit of Javascript that calls an ActiveX object that is part of Microsoft Sharepoint.

rjmunro