Hi all,
In my VS2010 extension, I have just encountered a situation which I can find no workaround for. As always, I went to Carlos Quintero's MZ-Tools first to see if I could find an answer. In this excellent article of his (http://www.mztools.com/articles/2007/mz2007027.aspx), he discusses how to get "the ProjectItem in the desired view using ProjectItem.Open(viewKind), which returns an EnvDTE.Window object."
This is the behavior I have experienced until I noticed that if a user selects "Open With..." and sets a default external program to open a given item with, I can no longer programmatically open the item in the text editor (this is required functionality for my extension, since I am not setting the Window to visible, anyway). The screenshot below illustrates my point, even though I am working with my own custom extensions.
In this case, calling ProjectItem.Open with every available ViewKind value will cause Program.cs to open in Notepad rather than the text editor. The Window returned from the Open call is always null in this case.
Is there any way I can force an item to open in the text editor, regardless what its default program/viewer is? Thanks for your help,
-Mike