10

I have a page which displays links to Word documents stored in SharePoint 2010. In order to allow the user to open the linked document by clicking the hyperlink, without being prompted to open or save, I have included the OpenDocuments ActiveX plugin like so,

var spod3 = new ActiveXObject('SharePoint.OpenDocuments.3');

The first time the page loads, the user is prompted with the normal open/save download prompt (screenshot here). This is not the correct behaviour. The document should open in word automatically.

If the user opens the document, the next time they open any document from that same URL, the plugin behaves as expected and opens the document in Word.

If the user cancels the prompt, and clicks again on any link for that same URL, they will be prompted again.

So it seems like some kind of initialisation occurs when the user opens the document from the prompt. But because my URLs may change depending on database values, the most likely every-day usage will be for a unique URL, and opening a document from that URL for the first time.

I have seen this behaviour with IE10 and IE8.

Even if there is not a definitive answer at this stage, troubleshooting steps would be helpful.

3
  • Have you tried looking in the Advanced settings of the Library and choosing "Open in client application"?
    – Mike
    Dec 10, 2012 at 18:16
  • The web page is not a SharePoint page or control, it's a whole other application. Just the href is pointing to a SharePoint resource.
    – jhsowter
    Dec 11, 2012 at 8:30
  • 3
    I smell either an authentication or a cross-site protection problem of some sort. Open up Fiddler and see what's happening between the browser and server when you get the login prompt.
    – James Love
    Dec 22, 2012 at 19:43

1 Answer 1

1

You should initialize the ActiveXObject before page load and if possible put an alert to see if it's properly initialized or not. It can be a scenario where request is already processed before object is initialized. You can initialize the ActiveXObjectonce and reuse the EditDocumentproperty for different documents like this.

spod3.EditDocument("http://server.com/folder/file.doc");

Do share your results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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