MS Word files in SharePoint Web Part

Update: This post was featured on the Microsoft Channel 9 5 year anniversary episode(opens in a new tab) (Around 15:35 in the video stream).
When Microsoft released their Office 2007 suite of applications they introduced the new Office Open XML standard as well. This XML standard would be the default format for all their applications and the structure of the files would be made an official ECMA standard(opens in a new tab).
As this standard is based on XML, the content of - for example - an MS-Word file should be relatively easy to parse and then do something useful with it. Something useful is in the eye of the beholder and James Newton King thought it was a good idea to set a couple of months aside and use it as a showcase for Silverlight 2.0, resulting in TextGlow(opens in a new tab), a Silverlight control that, you guessed it, can display MS-Word files.
This article shows you how to embed TextGlow into SharePoint and use it to display content stored in a Document Library.
TextGlow in SharePoint
OK, let’s get started
Make sure you have a copy of Silverlight 2.0(opens in a new tab) installed on your system
Navigate to an existing or create a new SharePoint site collection.
Download the TextGlow Silverlight viewer(opens in a new tab), unzip and copy the TextGlow folder (including the folder) to a document Library named ‘Shared Documents’
Add a new Content Editor Web Part (CEWP) to a page of your choice and set the height to something suitable (I used 700 pixels),
Open the Source Editor for the CEWP and paste in the following code.
<object data="data:application/x-silverlight," type="application/x-silverlight"
style="width:100%; height:100%">
<param name="source" value="Shared%20Documents/TextGlow/TextGlow.Control.xap" /\>
<param name="initParams" value="documentPath=Shared%20Documents/TextGlow/Test.docx" /\>
<a href="https://www.microsoft.com/silverlight/resources/install.aspx">
<img src="https://go.microsoft.com/fwlink/?LinkId=108181" style="border-style:none;" />
</a>
</object>
- Save the changes and admire the results of your work.
Please note that TextGlow is a proof of concept only. It crashes (badly) if you throw a document at it that is more than a few pages long. If you don’t like it then you can fix it yourself as the TextGlow source code has been open sourced(opens in a new tab). Alternatively you can use something more mature such as our PDF Converter for SharePoint(opens in a new tab) and display the resulting PDF file in the Page Viewer Web Part.