In a Visual Studio macro, how do you write execution information on the output pane (i.e. the window that usually contains build output)?
I'm using Visual Studio 2008, if that is relevant.
Solution: I added the following subs to my macro project, I'm posting them here in case they could be useful.
Private Sub Write(ByVal name As String, ByVal message As String)
Dim output As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
Dim window As OutputWindow = output.Object
Dim pane As OutputWindowPane = window.OutputWindowPanes.Item(name)
pane.Activate()
pane.OutputString(message)
pane.OutputString(Environment.NewLine)
End Sub
Private Sub Log(ByVal message As String, ByVal ParamArray args() As Object)
Write("Debug", String.Format(message, args))
End Sub
Private Sub Log(ByVal message As String)
Write("Debug", message)
End Sub
A quick search revealed this article on Code Project. It should be able to help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With