Delen via


CommandWindow.OutputString Method

Sends a text string to the Command window.

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

Syntax

'Declaration
Sub OutputString ( _
    Text As String _
)
void OutputString(
    string Text
)
void OutputString(
    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

OutputString does not automatically add new line characters to the string. If you want such characters in the string, you must add them to Text.

Examples

Sub CommandWinExample(ByVal dte As DTE)
    ' Get a reference to the Command window.
    Dim win As Window = _
    DTE.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow)
    Dim CW As CommandWindow = win.Object

    ' Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", False)

    ' Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft _
    website.")

    ' Clear the contents of the Command window.
    MsgBox("Clearing the Command window...")
    CW.Clear()
End Sub
void CommandWinExample(_DTE dte) 
{
    // Get a reference to the Command window.
    Window win =    
    dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
    CommandWindow CW = (CommandWindow)win.Object;

    // Input a command into the Command window and execute it.
    CW.SendInput("nav https://www.microsoft.com", false);

    // Insert some information text into the Command window.
    CW.OutputString("This URL takes you to the main Microsoft 
    website.");

    // Clear the contents of the Command window.
    MessageBox.Show("Clearing the Command window...");
    CW.Clear();
}

.NET Framework Security

See Also

Reference

CommandWindow Interface

EnvDTE Namespace

Other Resources

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