Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Public Module ImmediateWindow 'GUID for the Immediate Window Public Const GUID As String = "{ECB7191A-597B-41F5-9843-03A4CF275DDE}" Public Sub Clear() Dim win As Window = DTE.ActiveWindow DTE.Windows.Item(GUID).Activate() DTE.ExecuteCommand("Edit.SelectAll") DTE.ExecuteCommand("Edit.ClearAll") win.Activate() End Sub Public Sub ClearAndActivate() DTE.Windows.Item(GUID).Activate() DTE.ExecuteCommand("Edit.SelectAll") DTE.ExecuteCommand("Edit.ClearAll") End Sub Public Sub Activate() DTE.Windows.Item(GUID).Activate() End Sub End Module