I'm running VS 2008 with Excel 2007.
Perhaps I need to clarify my question. When I'm running VSTO directly
inside of Visual Studio (as opposed to opening up the Excel solution outside
of VS), and I use Console.Writeline in my code, VS does in fact have a
Console output window, and Console.Writeline from a normal VB program running
inside of VS does write the output to the Console window. However, when I
try this from VB code in VSTO
Console.Writeline("This is a test")
I don't get any output anywhere.
To test the above, create an Excel Worksheet VSTO solution, add a button
(Button1) to the Excel spreadsheet, and Add Code the the buttion for the
Button1 Click event handler that simply says
Console.Writeline("Button1 was clicked") : Stop
Then run the solution from VS (e.g. hit F5), and click Button1. The program
should stop at the Stop statement (confirming the previous code was
executed). However, the "Button1 was clicked" does not show up anywhere that
I looked, including VS's Console, Immediate, and Command windows.
(Obviously, if I run open the Excel file outside of VS, I wouldn't expect any
output--I would like it inside of VS for debugging purposes.)
As for you comment on Debug.Print, I don't understand where to make the menu
selection you suggested. Under VS's View menu, there is no option for
"Debug". Under VBA, Debug.Print will in fact print to the VBA Immediate
window (that works fine on my system), but I'm not writing VBA, I'm writing
VB in VSTO.

Signature
Ed
> Hello Ed,
>
[quoted text clipped - 35 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
Jialiang Ge [MSFT] - 31 Jul 2008 08:14 GMT
Hello Ed,
1. Debug.Print
I meant the window at VS->View->Output or VS->Debug->Windows->Output by
"Output Window".
You said that by no mean could you find the output of Debug.Print, would
you please check whether the current build mode is set to "Debug" (To
better illustrate it, I have sent an email to you with the screenshot)? Is
the "DEBUG" constant defined in the build option? Debug.Print outputs the
content to the Output Window as long as we are in Debug mode and the
"DEBUG" constant is defined.
2. Console.WriteLine
Console.Write outputs the content to the standard IO. You can see the
output in the "Console Window" of a normal Winform project, because the
Winform package helps us to redirect the content to the window. But for
VSTO, the VSTO package did not do it because the VSTO designers believe
Debug.Print is functional enough for the purpose.
If you have any other questions or concerns, please DON'T hesitate to tell
me.
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Ed White - 31 Jul 2008 18:42 GMT
Thanks very much for this response. I tried it, and it works, except the
Debug.Print does not output to the Output window, it outputs to VS’s
Immediate window on my PC.

Signature
Ed
> Hello Ed,
>
[quoted text clipped - 34 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> =================================================