Last year I created and uploaded a demonstration project to Popfly that converted a Word 2007 Document to a WPF FlowDocument. The best example of a FlowDocument can be seen in the New York Times Reader, an instance of Syndicated Client Starter Kit. I used this demo to create an online version of a whitepaper I wrote on Silverlight and Web Analytics. The mechanics of the add-in are this:
- It is a Word 2007 Add In - an Office Business Application written in C#
- The Add-in is surfaced using a Ribbon Tab
- It uses XSLT to transform the Microsoft Office Open XML for Word 2007 to WPF XAML rooted with a FlowDocument
- On Windows, the resulting FlowDocument XAML can be opened directly in either FireFox or Internet Explorer if .Net 3.5 is installed on the system.
Using the same technique, I wanted to try adapting that transform to create Silverlight 2 text. Unfortunately the FlowDocument is not in the Silverlight 2 Beta 2 but there is a TextBlock element that can be used to support fairly rich text output.
I updated the Add-in by adding a selector to switch between WPF FlowDocuments and Silverlight 2 TextBlocks.
I just added this project to CodePlex so you can check out the source code or just install it. Be warned, it's not perfect or complete, so please add your comments in the discussion forum on the CodePlex project.