Wednesday, July 23, 2008
Lockdown Mode Feature
Monday, July 21, 2008
Word Document Preview
I occupied myself with building a quite simple Word document preview functionality in SharePoint. In some situations it might be handy to take a peek in the content of a Word document (read: DOCX document) before opening, editing, ... In most cases, styles and images used in the document doesn't matter - we just want to recognize our previously written document by reading some text content.
Solution
To accomplish this functionality I made use of Eugene Pankov's DocxToText class available at codeproject (modified it a bit) and used the open-source ZIP library SharpZipLib. Maybe I'll take the time to rewrite this functionality with the System.IO.Packaging namespace in the near future.
Attention
I know, the solution isn't 100% complete and not tested extensively. The errorhandling isn't optimal and the functionality is limited yet (sort documents by name, paging is enabled, display x content blocks) ... but feel free to modify to your needs. Download the solution.
Screenshots
Custom Action on every document library
Custom application page
Content appears when you hover over the document name (standard 5 alineas)
When 5 alineas isn't enough ... change the textbox value