Subscribe to News feed

Displaying MS-Word files in a SharePoint Web Part using TextGlow and Silverlight

Posted at: 6:42 PM on 04 April 2009 by Muhimbi

Update: This post was featured on the Microsoft Channel 9 5 year anniversary episode (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.

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, 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. It is assumed that you are familiar with the Content Editor Web Part, if not then check out Todd Bleeker’s excellent resource on this topic.

TextGlow TextGlow in SharePoint

OK, let’s get started

  1. Make sure you have a copy of Silverlight 2.0 installed on your system
     
  2. Navigate to an existing or create a new SharePoint site collection.
     
  3. Download the TextGlow Silverlight viewer, unzip and copy the TextGlow folder (including the folder) to a document Library named ‘Shared Documents’
     
  4. 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),
     
  5. 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="http://www.microsoft.com/silverlight/resources/install.aspx">
         <img src="http://go.microsoft.com/fwlink/?LinkId=108181" style="border-style:none;" />
      </a>
    </object>
     
  6. 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. Alternatively you can use something more mature such as our PDF Converter for SharePoint and display the resulting PDF file in the Page Viewer Web Part.






Labels:

2 Comments:

  • Estimado: Al seguir los pasos sale es error:

    Dear: the follow next, show this error:

    Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator.

    Atte
    Marcelo

    By Anonymous Anonymous, At 29 May, 2009 15:04  

  • The TextGlow seems to come up, but the document is not showing... suggestions?

    By Blogger Walter, At 08 April, 2010 21:48  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link