Visual Studio Add-In to Output Source Files in HTML Format


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Have you ever found yourself looking at a design document with source code embedded and wondered why isnt this stuff formatted in a way that makes it easier to read? Have you wanted to print out some source and want to emphasize the comments and keywords? Well let me tell you I have.

You can now do all of this from within Developers studio. I spent a couple of Saturdays writing a couple of add-ins that will do this. The first one is HtmlOut and it will convert the source into an HTML file with full syntax highlighting.

A couple of notes on this dialog. The output to RTF is always grayed because it has not been implemented yet. The Project Files radio button under display file causes a read of the .dsw file (Probably will break in future versions of DevStudio). The List control does not act correctly (I think any way).

The next item is the print portion. It is pretty much the same as the HtmlOut except is sends the output to the printer. The same dialog is used as above so the same notes apply.

Before I post the source code I would like to clean it up first. Like I said I wrote this in a couple of weekends so its pretty messy, however if you just cant wait e-mail me and I will send it to you as is.

I need to point out a few people that helped make this possible.

Andrei Stcherbatchenko The syntax coloring text editor. I used this code to do the parsing for me. This is a great set of classes unfortunately I butchered these to get the effect I wanted.  http://www.codeguru.com/editctrl/crysedit.shtml

Chris Maunder The Hyperlink control and the color selection combo boxes. Once again a great set of classes.  http://www.codeguru.com/controls/hyperlink.shtml

Giancarlo Iovino An improved Hyperlink control. Great control that I use a lot.  http://www.codeguru.com/controls/hyperlinkex.shtml

CodeGuru This is the best web site for developers around.

To install:
Download Add-In
Close DevStudio
Extract the zip to the dev studio addin directory. Should be something like c:\Program Files\Microsoft Visual Studio\Common\MsDev98\AddIns
Launch DevStudio
Click the Tools\Customize menu item.
Click The Add-ins and Macro files tab.
Check the "HtmlOut Developer Studio AddIn" and "Print Color class"
Click Close.
You will now have two small tool bars. You can use the Alt Dag method to move these new buttons to your regular toolbars.

Download Add-In (sans source) - 54 KB

Date Last Updated: April 26, 1999

This article was originally published on April 26th, 1999

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date