How to use Office Webb Apps in a .Net application

My colleagues were developing a .Net application and they wanted to use the Office Web Apps to previsualise files, such as, word, ppt or pdf.

We were discussing about the issues and finally we opt to implement a server with Office Web Apps and use it to try how to implement it, so let’s go:

We have to take into account that by default the Office Web Apps new farm configuration does not set OpenFromURLEnabled to True. So to use it, it is neccessary to set to True by running the command below in Powershell on the WAC Server

Set-OfficeWebAppsFarm -OpenFromURLEnabled

Setting this propertie to True, Office Web Apps Server provides a page at the address http://OfficeWebAppsServername/op/generate.aspx that you can use to generate links to publicly available documents that have UNC or URLaddresses. When a user selects a generated URL, Online Viewers enable Office Web Apps Server to get the file from its location and then render it by using Office Web Apps.

Next is to create a folder inside the server (or in a NAS or whenever you want), but it is necessary that the computer that run the Office Web Apps farm has permissions on it.

WAC%20Blog.PNG-550x0

Also it is necessary to share the folder with everyone:

5164.Everyone.PNG-550x0

Next step it to generate the URL, so we need to open IE and go to the folowing URL: http:///op/generate.aspx

Use the URL that is next to “InternalURL” when you perform Get-OfficeWebAppsFarm

If you are not using an “InternalURL” then you will obviously have to use “ExternalURL”

Enter the UNC location of the workbook

Click ” Create Link ” and then click “Test this link.”

wapps

So, now we have to methods to access to the file:

http://wapps2013/op/view.aspx?src=%5C%5CWAPPS2013%5CTest%5Cbeone.docx

And an Iframe to insert in a WebApp…

http://wapps2013/op/embed.aspx?src=%5C%5CWAPPS2013%5CTest%5Cbeone.docx

So we can try the previsualization of the file and If this works, then you know the WAC Server can render the workbook and something else is configured incorrectly.

Hope that helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s