This post originated from an RSS feed registered with .NET Buzz
by Chris Flaat.
Original Post: Open With (or, another great hidden feature revealed)
Feed Title: Chris Flaat's Weblog
Feed URL: /msdnerror.htm?aspxerrorpath=/cflaat/Rss.aspx
Feed Description: I mainly discuss tips & tricks about VS 2002, VS 2003, and upcoming versions of VS.
Well, I'm back. Had a great time in Minnesota, but alas, all good vacations
must come to an end. I have some reflections which I might share later, but
right now I want to tell you about another highly useful feature which is so obscurely
hidden that some of you may not realize it's there. The feature is opening up
a file with a different "editor", for example to view an icon with the binary editor
instead of the graphical icon editor, or to open an XML file with the ordinary text
editor instead of the XML designer.
Now, when most people hear the word "editor" they probably think of the source code
editor which lets you edit text. That's indeed an editor, but in VS lingo we
use the term "editor" to mean any view on a file or other item. Editors include
the text editor, the bitmap editor, the icon editor, the XML editor, the binary editor,
etc. (If you're a 3rd party that joins the VSIP
program you can add your own fully integrated editors, although read on for a
low-tech way to add new ones.)
To pick an arbitrary editor for a file or item, do ctrl+O or File.Open.File and navigate
to the file. But DON'T hit the Open button. Instead, notice the little
down-pointing arrow at the right edge of the Open button? Click it, and there
will be two choices, Open and Open With. Click on Open With. Now the
"Open With" dialog will pop up, showing a list of available editors for the file.
Note that not all will actually work in all cases (e.g. trying to use the text editor
for an .ico file will usually fail). The most common uses for this are to fall
back to the plain text editor or the binary editor if using another editor doesn't
show you the data you want for some reason.
The Open With dialog does some other nifty things. You can use it to change
the default editor that is used for a given file type, or to add other programs to
the list of available editors. (When you add other programs as editors in this
way they will simply launch external to VS, and won't be integrated; to add an integrated
editor you need to be a VSIP.)
For more about the Open With dialog, see here.