将sharepoint .docx文件传递给microsoft office word web app

时间:2011-07-21 17:21:58

标签: sharepoint web-parts office-web-components

我只是无法弄清楚如何做到这一点,我有一个完整的文件路径,但我无法弄清楚如何获得一个微软办公室word web应用程序来打开文件路径。有什么帮助吗?

2 个答案:

答案 0 :(得分:1)

您必须将.docs文件上载到SharePoint才能使用MS Office Web Apps。请遵循以下TechNet文章,了解如何deploy Office Web Apps验证安装。然后确保configure the default open behavior for browser-enabled documents

答案 1 :(得分:0)

尝试以编程方式执行此操作

 /YOURWEB/_layouts/WordViewer.aspx?id= "here is query string (path to the document)"

<SharePoint:MenuItemTemplate ID="submit1"  runat="server"   Text="open"  ImageUrl="/_layouts/images/OpeninBrowser.gif"  ClientOnClickScript="OpenWebApps('%Url%'); return false;">

function OpenWebApps(url) {   
    var ext = url.substr(url.lastIndexOf('.') + 1);   // here define the extension
    if (ext == 'docx')  
        window.open('<%= Web.Url%>'+"/_layouts/WordViewer.aspx?id="+encodeURI(url));
    else
        alert('Cannot open document with this extension');
}