Visual Studio 2010 automation
- by JoelFan
I am trying to run the following code (which I got from here )
Public Sub WriteToMyNewPane()
Dim win As Window = _
DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
Dim ow As OutputWindow = win.Object
Dim owPane As OutputWindowPane
Dim cnt As Integer = ow.OutputWindowPanes.Count
owPane = ow.OutputWindowPanes.Add("My New Output Pane")
owPane.Activate()
owPane.OutputString("My text1" & vbCrLf)
owPane.OutputString("My text2" & vbCrLf)
owPane.OutputString("My text3" & vbCrLf)
End Sub
Instead of running it as a Macro, I want to run it as an independent console application that connects to a currently running instance of Visual Studio 2010. I'm having a hard time figuring out how to set the value of DTE. I think I may need to call GetActiveObject, but I'm not sure how. Any pointers?