Does anyone know how to get this data from the Error window? I followed this example, which allows me to obtain the selected error message. However, that only obtains the Description column. I can also get the Line Number and Document. However, I want to also get the text of the Error Code - and I can't find how to get the Code.
In the above example, I also want to get 'CS1002'.
I also tried this code, which gives me more fields (but not the Code field), but does not get me the selected item - it is a list of all items in the Error List window...
EnvDTE80.DTE2 dte = (EnvDTE80.DTE2)Package.GetGlobalService(typeof(SDTE));
Assumes.Present(dte);
ErrorList errorList = dte.ToolWindows.ErrorList;
for (int i = 1; i <= errorList.ErrorItems.Count; i++)
{
var itm = (ErrorItem)errorList.ErrorItems.Item(i);
MessageBox.Show(itm.Description);
}

Got it! This worked, you just have to know the proper column names to search for.