0
votes

I am working on a site where users can upload Word and Excel documents. Once uploaded, the file is saved on a network drive, not into SharePoint.

I now need to display these files by embedding them on the page. I would like to avoid using an ActiveX plugin and read that SharePoint can be used to display these documents on the page.

My only concern is that these files were not directly uploaded into SharePoint, so I am not sure if this approach would work.

Is it possible to use a SharePoint API and pass in the path to the file so that SharePoint would create the HTML that I would need to embed the document?

1
You do not want to use standard xlviewer.aspx page wich is used by sharepoint to show xls documents in browser? BTW which version of SharePoint are you using? - Yevgeniy.Chernobrivets
We are using 2010. I've never used SP before, so didn't realize it already had xlviewer.aspx. Is it possible for it to display files that are not in the Document Library? - Cloud SME
Unfortunately no, you cannot use it with documents that are not on SP. - Yevgeniy.Chernobrivets
There is a chance that you can create custom which extends standard and add required functionality but this will require deployment of farm solution. - Yevgeniy.Chernobrivets
I just checked current implementation with Reflector and i'm afraid that even extending existing page won't help - it calls some excel services (probably hosted on excel services service application) and it accepts SP urls only. - Yevgeniy.Chernobrivets

1 Answers

0
votes

Have a look at this article:

http://blog.maartenballiauw.be/post/2008/01/11/Preview-Word-files-%28docx%29-in-HTML-using-ASPNET-OpenXML-and-LINQ-to-XML.aspx

Using this article, you can either create a WebPart, which can read the files and render them in SharePoint

OR

You can create an ASP.NET site to render the DOCX on webpage and use the Url in Page Viewer webpart in SharePoint.