> I want to output some data in OutputWindowPane while a rather lengthy
> macro is running. The problem is that I don't see any output until
> the macro is finished - then all the output appears at once.
I'm afraid I can't (currently) help with the problem, but I am curious as to
how you're getting any output to appear at all.
I have a macro that runs on the OnBuildDone event, and I've tried everything
I can think of to get it to communicate with the user that initiated the
compilation. The only thing I've managed to do is display a MsgBox(), which
is much too intrusive for what I'm trying to do.
If you could let me see how you're getting text to the OutputWindowPane I'd
be most grateful. In return I'll see if I can find any way to get it to
display immediately.
TIA,

Signature
(O)enone
Boris - 28 Sep 2006 01:32 GMT
> [...] If you could let me see how you're getting text to the
> OutputWindowPane I'd be most grateful. In return I'll see if I can
> find any way to get it to display immediately.
Check out the Utilities module in the Samples project. There is a function
called GetOutputWindowPane. I copied this function to my own project and use
it like this:
Dim outputWindowPane As EnvDTE.OutputWindowPane
outputWindowPane = GetOutputWindowPane("My report")
outputWindowPane.OutputString("Test" + vbLf)
HTH,
Boris
Dirk - 28 Sep 2006 02:03 GMT
>> I want to output some data in OutputWindowPane while a rather lengthy
>> macro is running. The problem is that I don't see any output until
>> the macro is finished - then all the output appears at once.
>
> I'm afraid I can't (currently) help with the problem, but I am curious as
> to how you're getting any output to appear at all.
I have the same problem as the original poster. The output is only visible
when the macro has finished. I hope there is something like Excel's
Application.ScreenUpdating. Here is how I display the output.
' Prepare output pane
With DTE.ToolWindows.OutputWindow.OutputWindowPanes
Try
' Get existing "Macros" pane
outputPane = .Item("Macros")
Catch ex As ArgumentException
' Does not exist yet, create new one
outputPane = .Add("Macros")
End Try
outputPane.Clear()
outputPane.Activate()
End With
' Make output window visible
DTE.ToolWindows.OutputWindow.Parent.Visible = True
' Then call this method during macro execution to display something
' Writes a single line including line feed to the output pane.
Private Sub OutputWriteLine(ByVal format As String, ByVal ParamArray args As
Object())
outputPane.OutputString(String.Format(format, args) & vbCrLf)
End Sub