Pergunta

Actually I need to know if 2013 version of MS Office installed. Approach with

var oApplication=new ActiveXObject("Word.Application");

does not work for me from website (but it works when run it from local disk).

Foi útil?

Solução 3

Okey, so here is the answer (SharePoint works properly with both old and new Office clients without version detection, so there must be a solution)

try {
    var g = new ActiveXObject("SharePoint.OpenDocuments.5");
    alert('Office 2013 installed');
    window.open('ms-word:ofe|u|http://server.com/12.docx');
}
catch (h) {
    alert('Office 2010/older installed');
    var g = new ActiveXObject("SharePoint.OpenDocuments");
    g.EditDocument('http://server.com/12.docx');
}

The only problem left is document opening in 'Protected View' while SharePoint opens them in regular view.

Outras dicas

I debugged in Office365:
ms-powerpoint:ofe|u|https://.... => Powerpoint
ms-word:ofe|u|https:// => Word
ms-excel:ofe|u|https:// => Excel

You can't instantiate ActiveX controls which aren't marked "Safe for Scripting" from the Internet Zone in IE (and the Office apps aren't SFS).

What "old mechanism" were you using prior to Office 2013 and what "new mechanism" are you planning to use?

(Keep in mind that SharePoint works properly with both old and new Office clients without version detection).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top