Share via


OutputWindowPane.OutputString Method

Sends a text string to the OutputWindowPane window.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub OutputString ( _
    Text As String _
)
void OutputString(
    string Text
)
void OutputString(
    [InAttribute] String^ Text
)
abstract OutputString : 
        Text:string -> unit 
function OutputString(
    Text : String
)

Parameters

  • Text
    Type: System.String
    Required. The text characters to send to the window.

Remarks

This method does not automatically add newline characters to the string. If you want such characters in the string, you must add them to Text.

Examples

Sub OutputStringExample(ByVal dte As DTE2)

    ' Find and show the "Test Pane" Output window pane.
    Dim outputWin As OutputWindow = dte.ToolWindows.OutputWindow
    Dim pane As OutputWindowPane
    Try
        pane = outputWin.OutputWindowPanes.Item("Test Pane")
    Catch
        pane = outputWin.OutputWindowPanes.Add("Test Pane")
    End Try
    outputWin.Parent.Activate()
    pane.Activate()

    ' Add a line of text to the new pane.
    pane.OutputString("Some text." & vbCrLf)

End Sub
public void OutputStringExample(DTE2 dte)
{
    // Find and show the "Test Pane" Output window pane.
    OutputWindow outputWin = dte.ToolWindows.OutputWindow;
    OutputWindowPane pane;

    try
    {
        pane = outputWin.OutputWindowPanes.Item("Test Pane");
    }
    catch (Exception)
    {
        pane = outputWin.OutputWindowPanes.Add("Test Pane");
    }

    outputWin.Parent.Activate();
    pane.Activate();

    // Add a line of text to the new pane.
    pane.OutputString("Some text." + "\r\n");
}

.NET Framework Security

See Also

Reference

OutputWindowPane Interface

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples