문제

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).

도움이 되었습니까?

해결책 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.

다른 팁

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top