Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio 2008 macro: write to output pane

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
like image 983
Paolo Tedesco Avatar asked Sep 30 '09 09:09

Paolo Tedesco


1 Answers

A quick search revealed this article on Code Project. It should be able to help you.

like image 109
Pete OHanlon Avatar answered Sep 21 '22 21:09

Pete OHanlon