Let me start by saying I'm new to developing add-ins for visual studio...
When using the DTE2 object, I am attempting to get some info on the document that is currently selected. If I do something like this:
DTE2 VisualStudioInstance = somethingOrOther;
Document documentInfo;
if(VisualStudioInstance.SelectedItems.MultiSelect == false)
{
documentInfo = VisualStudioInstance.SelectedItems.Item(1).ProjectItem.Document;
}
The Document object always seems to be null. VisualStudioInstance.SelectedItems.Item(1).Project is also null (which I don't necessarily need, but that seems odd as well. It does give me the name of the selected item, so I know at least that it is finding something.
Now if I go directly to VisualStudioInstance.ActiveDocument, I get all the info I am looking for. Does the document actually have to be open to get the information? If so, how else would I go about getting document info for a selected item without opening it? The main thing I'm looking for is full path information for the selected file. Thanks in advance.