Tatham Oddie

Released: Windows and Office Preview Handler Pack

with 77 comments

(Note: I completely rewrote this post on 18th March 2010 to bring it all up to date.)

Back with the release of Windows Vista, Microsoft introduced the concept of preview handlers. These let you preview all different file types from within Windows Explorer. Even better, they are both extensible (so you can add more types) and they work in Office too.

To make them more developer friendly, I developed a set of preview handlers for file types commonly used by developers.

Download Now

The pack works with:

  • Windows Vista
  • Windows 7
  • Outlook 2007
  • Outlook 2010

The pack adds support for:

  • ActionScript (.as)
  • ASPX (.aspx)
  • C# (.cs)
  • CSS (.css)
  • Diff (.diff, .patch)
  • DOS (.bat, .cmd)
  • JavaScript (.js)
  • Ruby (.rb, .rhtml, .rjs) thanks to Ivan Porto Carrero
  • SQL (.sql)
  • VB (.vb)

The project is basically just a stitched together set of other people’s work – there wasn’t much left for me to do considering:

If you’re interested in contributing your own ideas or adding more file types, just over to the source repository on CodePlex.

Previewing a C# (.cs) file in Vista

Previewing as ASP.NET (.aspx) file in Vista

Previewing a TSQL (.sql) file in Vista

Written by Tatham Oddie

December 20, 2006 at 18:03

Posted in Uncategorized

77 Responses

Subscribe to comments with RSS.

  1. Heya Tatham – very nice man!
    This will definitely come in handy.

    Cheers,

    Matty

    Matthew Cosier

    December 20, 2006 at 21:21

  2. Hi Tatham.

    Do you actually use Vista on your dev machine? I really like the vista styple + the new features but I am hesitating to upgrade because I heard rumours about nasty bugs with VS and especially third party software that runs smoothly on XP.

    bye,
    Elmar

    Elmar

    December 20, 2006 at 21:25

  3. P.s.: *.config

    Elmar

    December 20, 2006 at 21:27

  4. [...] Vista and Office 2007 Preview Handler Pack can be downloaded here. To install it you will need run the installer as Administrator. Beside, if you have any other file types in mind that you would like to has the preview ability too, simply tell the author and he may include the support for that file ext. [...]

  5. [...] Being a good coder I’ve taken my laptop on holidays with me, and decided that tonight would be a good time to tackle the UAC issue with my Vista preview handlers. [...]

  6. how do i preview pdf files in outlook 2007 with the operating system as XP.

    vivek

    February 16, 2007 at 23:30

  7. [...] Excel 2007 worksheets. Microsoft Office Visio 2007 drawings. Images and text files. Check this cool Preview Handler for *.cs and *.aspx!     Share this post: email it! | bookmark it! | digg it! | reddit! | kick [...]

  8. Awesome. thank you

    cyanbane

    March 2, 2007 at 08:09

  9. anychance of a html previewer ?

    prox

    March 25, 2007 at 07:58

  10. [...] Ruby and JScript support added to Preview Handler Pack Filed under: Uncategorized — Tatham Oddie @ 15:03 I’m pleased to announce that Ivan Porto Carrero and I have managed to add support for Ruby and JScript files to the Preview Handler Pack. [...]

  11. The site looks great ! Thanks for all your help ( past, present and future !)

    morganusvitus

    April 6, 2007 at 12:02

  12. [...] CSS and Diff/Patch support added to Vista and Office 2007 Code Preview Handler Pack Filed under: Uncategorized — Tatham Oddie @ 14:17 Even more file types now supported! Read more about the Vista and Office 2007 Code Preview Handler Pack [...]

  13. [...] · Vista and Office 2007 Preview Pack (soporte para archivos .cs,.aspx, .sql) [...]

  14. Would it be possible to build a Visio previewer? We use it all the time and can’t preview files in Vista. It is really annoying.

    Nelson

    July 17, 2007 at 03:32

  15. @Nelson:

    Wow – you mean they still make Visio? :p

    If you’ve got any ideas on how I can render a Visio document in Windows Forms, I should be able to add this support for you relatively easily.

    Tatham Oddie

    July 17, 2007 at 03:36

  16. XP did make the preview the first image of the cbr(rar)and cbz(zip) format files used for comics. A very practical tool to easily explore your collection. This feature is not supported now in Vista letting only to artists in programming as you to do the job. Such a “visual” system as Vista could be more consistent with early steps yet conquered. Normal users missing that facility will wait for an experienced and kind programmer to complement again the lazy Bill’s programmers. However, in the interim, congratulations on your new preview handlers.

    Nando

    August 24, 2007 at 20:40

  17. Great tool, thanks

    ramon

    September 11, 2007 at 10:02

  18. It works great, but it has one small annoying problem. When, for example, I preview a file (a .sql file in this example), and then I edit it in notepad, I cannot save the file because there is still an open handle to it.

    Even after I click off of the file, the handle still remains. I have to close the explorer instance to get the handle to let go of the file.

    I figure this is just a part of the methods provided…but i thought i’d ask anyway.

    Steven Vallarian

    November 16, 2007 at 05:41

  19. What? No PHP preview?

    Michael Ott

    January 1, 2008 at 09:57

  20. Very nice.

    I’d love to see some .as (actionscript) preview support, it’s pretty much ecmascript/javascript.

    dave

    February 15, 2008 at 01:07

  21. Hi Dave,

    I’ve associated .as with the existing JavaScript previewer.

    Thanks for the note. :)

    Tatham Oddie

    February 15, 2008 at 11:06

  22. [...] Vista and Office 2007 Preview Handler Pack released « Enter the Tatrix Vista and Office 2007 Preview Handler Pack released (tags: vista shell preview installer msi windows win32 outlook) [...]

  23. [...] I’m using Office 2007 for some time now and the ability to preview the content of some files without actually opening them in the dedicated editor is quite nice. It’s a pity that the number of supported file types is so small. A good thing is that they everyone can create such a preview handler, because the API is publicly available and documented on MSDN. So I looked around the net today for some handlers that would allow me to preview zip archives and some other common file types – like .as or .mxml. One of the interesting resources I’ve stumbled onto is a blog post that links to a msdn article and also to download the handlers demoed. Get at it here. Another pack of handlers for some of the programming language files is here. [...]

  24. I just recently downloaded and installed this utility and I’m having a problem. When I try to preview .sql files it says there is a problem with the T-SQL previewer. Are there any known issues with this previewer? I’ve even tried rebooting the computer but now success.

    Thanks!

    Erik

    Erik

    March 11, 2008 at 05:22

  25. Woohoo – we passed the 1000 download mark last fortnight and I didn’t even realise. I seriously didn’t even think people were using this …

    Tatham Oddie

    March 11, 2008 at 14:25

  26. very nice web site. My English is not so good, so I do not understandt it well, but it seems very good. Thanks

    Au Pair

    March 19, 2008 at 14:28

  27. I am just looking for a previewer for .html files. I know Vista has one, but has anyone written one for Outlook on XP? Many of us would be grateful if you did.

    David Campbell

    March 20, 2008 at 03:34

  28. Same problem with the T-SQL preview handler as Erik above. The error in the preview pane reads:

    This file cannot be previewed because of an error with the following previewer:

    T-SQL Code Preview Handler

    To open this file in its own program, double-click it.

    FYI, I’m using Outlook 2007 on Windows XP Pro SP2.

    Tatham, can you look into this? Thanks.

    Douglas

    April 2, 2008 at 03:43

  29. .xml, .xst, .xsd would be good too.

    Brian

    April 3, 2008 at 09:02

    • I agree, .xml, .xst, .xsd would be great too.

      Keith Brohaugh

      July 22, 2009 at 08:40

  30. Like Steven Vallarian, I have come across the problem that makes a previewer less than useful. If I preview an Excel file, an instance of Excel.exe is opened that stays open. This prevent me from double clicking an Excel file because the excel.exe that is already running prevents me from getting at Personal.xlsb, so my macros are not available.

    The only way I can use Excel freely is to shut down Explorer after previewing, then open Excel, then do File, Open and navigate to the file. Hardly practical!

    Could you suggest a solution?

    John Smith

    April 4, 2008 at 21:46

  31. How about adding support for VBscript (.VBS) files?

    Steve

    April 15, 2008 at 01:57

  32. I would love to be able to preview .MHT / .MHTML files

    This is the “Excel 2000″ output for some horrible reporting software we’ve been forced to use. It has other options, but this is on the only output we’ve found that we can even open. The Excel 2003 option simply doesn’t work, so we’re stuck with MHTML on dozens of daily reports. Drives me crazy!

    Mike

    May 13, 2008 at 03:22

  33. to Mike

    Download “MSDN Magazine preview handlers pack”:
    http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/PreviewHandlers2007_01.exe
    and associate .MHT / .MHTML estensions with “MSDN Magazine Internet Explorer Preview Handler”. Search for PreviewHandlerEditor(for the associate issue) on google../msdn../yahoo.. .
    You can do that for every FileType supported by Internet Explorer(pdf, svg, xml,…..(office),…, TeX)

    dott

    May 21, 2008 at 11:44

  34. I found a registry hack to support xml based files by previewing them with the aspx previewer:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\.xml\shellex]

    [HKEY_CLASSES_ROOT\.xml\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
    @=”{c3da7028-8de0-11db-96b6-005056c00008}”

    Paste this into an empty .reg file. Support for other filetypes can be added by replacing the .xml in the key.

    Manuel Riezebosch

    May 21, 2008 at 21:44

  35. It seems to lock my files so I’m unable to delete them after being previewed… :(

    Manuel Riezebosch

    May 21, 2008 at 23:48

  36. Great product But I’ve found another free preview handler which offers additional features:
    - Supports XML (.xml, .xsl)
    - Supports PHP
    - Supports Perl
    - Supports more than 20 other file formats
    - Written in C++. Faster and lower memory usage.
    - Files are not blocked when viewed. E.g. they can be saved/edited/deleted.

    The preview handler is available at:
    http://www.smartftp.local/client/addons/sourcepreview.php

    Regards,
    Cyber

    Cyber

    June 2, 2008 at 19:27

  37. I apologize for the wrong link in the last email. The correct link is:
    http://www.smartftp.com/client/addons/sourcepreview.php

    Cyber

    June 2, 2008 at 19:29

  38. I could use a preview handler for old Word Perfect files in .LTR and .WPD format.
    Thanks.
    Kelly

    Kelly Smith

    June 3, 2008 at 16:47

  39. Hello, Thanks for this article. based on my personal experience (I have tried it successfully) you can get more previews by integrating Vista Preview Pane with QuickView Plus (as IE plug in). (www.avantstar.com).
    unfortunately it’s a little expensive shareware with 30 days trial. But there’s always another “way”, you know what i mean.
    The vendor tells about it still doesnt fully support Vista, but the IE plug in will still be installed as well.
    It supports more than 400 file types included most of known documents, images, and even apps binaries. So superior in my opinion. You don’t need associated applications anymore, and mainly no need to create specific preview handler any more. same thing due to other IE viewer activex plug ins.
    1. Download and install QuickView Plus on Vista. Launch it, Configure your custom file for IE plug in by clicking View – Confifugure QuickView Plus – Applications – Internet Explorer (IE plug in). then add your custom files (e.g. .dwg, .psd, .dll etc with their correct content type (MIME)
    2. Download MSDN Preview Handler. Install it.
    3. Download Preview Handler Editor or Preview Handler Configure. Open it then Look for “MSDN Internet Explorer Preview Handler”. select and add your custom files
    4. Activate Vista /Outlook preview pane. Select your file. the preview appears perfectly now.
    That’s it. Hopefully works. To me, it always works so far.
    Thanx and regards-Amirz

    Amirz

    June 29, 2008 at 00:11

  40. to Cyber.
    Thanks for the info about smartftp source preview handler, is great.
    I manage to edit “SourcePreviewHandler.dll” using ResHacker and change the ugly Courier New font to Consolas, now is perfect ;-)

    dott

    July 4, 2008 at 05:38

  41. it would be better with other languages support, but thanks..

    lsi

    September 5, 2008 at 08:01

  42. Like Manuel, I also added additional extensions for the XML-type files. My current list is: .asax, .ashx, .config, .csproj, .resx, .user, .vbproj, .xml, .xsd, .xslt

    JohnB

    September 5, 2008 at 16:41

  43. HTML and XML please….Visio also useful

    Ray

    September 18, 2008 at 02:28

  44. is there a previewer for .wav files?

    pete

    November 20, 2008 at 03:35

  45. On my machine, under XP with Office 2007 it will not work to preview in Outlook 2007 for files received as attachments to emails.

    Outlook notices that the file extension of the attachment matches and gives you a button to click to preview but when you click the button it says there is an error in the previewer and you will have to double-click to see it.

    Any ideas?

    Thanks.

    Lee

    December 4, 2008 at 04:52

  46. I have the same experience on Server 2003 (enterprise) with Outlook 2007 — preview hanlder is registered, but an exception of some kind prevents it from previewing the attached file. In my case, I’m most interested in SQL files, I trade them frequently and would benefit from the previewer. I am using SSMS 2005 and SSMS 2008 on the same machine.

    Is this a file permission or Office trust issue?

    Rich

    January 14, 2009 at 04:41

  47. Hi I am using the windows 7 beta, any chance of getting the previewers working with windows 7?

    I loved your previewers on vista :-)

    Thanks

    Brian O'Neill

    January 23, 2009 at 04:32

  48. Hi,

    same problem as Douglas.

    Does anyone know how to preview *.sql files with Outlook 2007 ?

    thx

    Beber

    February 11, 2009 at 21:06

  49. [...] Coding preview hendler pack for Windows Vista [...]

  50. I cant get this thing to install… it just sits there saying “please wait” forever…..??

    Brandin

    February 25, 2009 at 08:46

  51. [...] = false; var tb_middle_badusa = false; tb_to_do_or_to_not(1239373140, ‘middle’, 4106); The Vista and Office 2007 Preview Handler Pack is a must have add-in for programmers, it allows users to preview several popular programming [...]

  52. Has the locking issue been taken care of yet? If not, is there any target date that a fix for the locking issue will be provided.

    smehaffie

    May 22, 2009 at 18:02

  53. Any chance of getting a previewer for the Cricut Design Studio software?

    kjonulak

    June 27, 2009 at 11:53

  54. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

    sandrar

    September 11, 2009 at 08:48

  55. Hi

    I have downloaded and installed – how do I enable/activate in Outlook?

    Fergal

    September 15, 2009 at 01:38

  56. my previewers in microsoft 2007 don’t preview pdf files. any1 got a solution

    Abe

    September 25, 2009 at 06:59

  57. And nice .wrl files ?!

    Antonio

    January 29, 2010 at 13:37

    • .wrl is VRML, right? Why would you want to preview that?

      Tatham Oddie

      January 29, 2010 at 13:45

      • I have made lots of!

        Antonio

        January 29, 2010 at 15:52

  58. Thanks for this – i’ve been searching for something like this for weeks. Nice job.

    Age Gould

    February 3, 2010 at 21:08

  59. Any chance you could post the code for this or put it up on github/googlecode? I’d be interested in contributing some patches/features.

    Jared

    March 2, 2010 at 02:18

  60. looks like there is a bug where the previewer doesn’t release the file lock correctly because I can no longer save a file after is has been opened in the preview pane. Anyone else seeing this?

    Jared

    March 9, 2010 at 05:09

  61. very nice!
    Only .csv file extension is missing (tried with Outlook 2010)
    Maybe you can add it?

    Mike

    April 26, 2010 at 19:07

  62. Hi there…

    I am Using Office 2010 and XP SP3…
    I am very keen to use this Preview handlers but dont know how to do it…

    I want to use since 6-7 Months when i was using office 2007…
    i want to preview HTM files in Preview pane but not able to do so…. only some Preview are available now like PDF preview but not the HTM one yet…

    help me to apply the preview handler in my computer…

    Thanks.

    Dakshesh

    April 28, 2010 at 21:21

  63. I can’t get the wav preview to work correctly in Outlook 2007 on Vista. I can see the preview in the preview window and I can play it, but I get no sound through the headset. All other system sounds are coming through the deadset fine. Any ideas?

    Tom

    May 11, 2010 at 04:59

    • Sorry its Windows 7 I cant get it to work properly in.

      Tom

      May 11, 2010 at 05:06

    • Hey Tom

      I want to do this preview handling in my outlook add-in but am kinda new to programming. So it would be great if you can tell me something how to start building one.

      binzidd007

      August 24, 2011 at 20:23

  64. I am also using Office 2010 and XP SP3…
    I am eager to know how could I preview HTM files in outlook…

    Sophia

    May 13, 2010 at 12:20

  65. Can this be added to and used in a home grown Explorer type program written in Microsoft Visual Studio 2008 C#??

    Carlos

    May 15, 2010 at 01:00

  66. Would be nice to have “.PS1″ support, my PowerGUI is so slow.

    Ross Lin

    November 10, 2010 at 17:08

    • Hi Ross,

      It’s all open source on CodePlex. ;) Feel free to add .ps1 support and I’ll publish a new build.

      – Tatham

      Tatham Oddie

      November 10, 2010 at 17:14

  67. Can we please get a x64 build?

    Will

    December 19, 2010 at 21:30

  68. [...] Tatham Oddie has created a package that includes .cs, .aspx, and .sql, .css, patch and .bat files and Ruby files (.rb, .rhtml and .rjs) and plain old Javascript (all of [...]


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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 31 other followers

%d bloggers like this: