Passing sharepoint .docx files to microsoft office word web app

2.2k views Asked by At

I just can't figure out how to do it, I have a full file path, but I can't figure out how to get a the microsoft office word web app to open the filepath. Any help?

2

There are 2 answers

1
Vassili Altynikov On BEST ANSWER

You have to upload your .docs file to SharePoint in order to use MS Office Web Apps. Follow the following TechNet article on how to deploy Office Web Apps to verify the installation. Then make sure to configure the default open behavior for browser-enabled documents.

0
shakizat On

Try this to do it programmatically

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

or

<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');
}