Hi
I think you have somewhat confusion about the Console.WriteLine's Console
and the Output Windows' Debug Panel.(I means here for VS.NET 2003, as for
Whidbey issue , it is not officially supported so far)
Actually when we call the Console.WriteLine, it will write in the process's
output stream buffer,(here it is the Excel or Word ... Debugee proecess),
and the Debugger Process(here is the IDE devenv.exe) will capture the
output string and display in the debugger(VS.NET IDE) 's output windows.
Because the excel or word process is not console app, Console.Clear()
throw the exception.
That is to they are in totally different two processes.(devenv.exe,
excel.exe)
Although we can run the macro in the VS.NET IDE to clear the outputwindows,
but it needed to run in the debugger's process.
Dim window As EnvDTE.Window
Dim outputWindow As EnvDTE.OutputWindow
Dim OutputWindowPane As EnvDTE.OutputWindowPane
window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
outputWindow = CType(window.Object, EnvDTE.OutputWindow)
For Each OutputWindowPane In outputWindow.OutputWindowPanes
If OutputWindowPane.Name = "Debug" Then
OutputWindowPane.Clear()
End If
Next
Usually we trace the addin, we can use the Debug.WriteLine and we can
capture the result with other tool, .e.g dbgview.
It will be found in the link below.
The Debug.WriteLine will prefix with a process ID which will tell one from
another.
http://www.sysinternals.com/ntw2k/freeware/debugview.shtml
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.