This documentation is archived and is not being maintained.

OutputTaskItemString Method

Visual Studio .NET 2003

Displays a string in the Output window and adds a corresponding item to the Task List.

[Visual Basic .NET]
Public Sub OutputTaskItemString( _
   ByVal Text As String, _
   ByVal Priority As vsTaskPriority, _
   ByVal SubCategory As String, _
   ByVal Icon As vsTaskIcon, _
   ByVal FileName As String, _
   ByVal Line As Integer, _
   ByVal Description As String, _
   Optional ByVal Force As Boolean = True _
) 
[Visual Basic 6]
Sub OutputTaskItemString( _
   ByVal Text As String, _
   ByVal Priority As vsTaskPriority, _
   ByVal SubCategory As String, _
   ByVal Icon As vsTaskIcon, _
   ByVal FileName As String, _
   ByVal Line As Long, _
   ByVal Description As String, _
   Optional ByVal Force As Boolean = True _
) 
[C++]
HRESULT __stdcall OutputTaskItemString(
   BSTR Text,
   vsTaskPriority Priority,
   BSTR SubCategory,
   vsTaskIcon Icon,
   BSTR FileName,
   long Line,
   BSTR Description,
   VARIANT_BOOL Force
);
[C#]
public void OutputTaskItemString(
   string Text,
   vsTaskPriority Priority,
   string SubCategory,
   vsTaskIcon Icon,
   string FileName,
   int Line,
   string Description,
   bool Force
);
[JScript .NET]
public function OutputTaskItemString(
   Text : String,
   Priority : vsTaskPriority,
   SubCategory : String,
   Icon : vsTaskIcon,
   FileName : String,
   Line : int,
   Description : String,
   Force : Boolean
)

Parameters

Text
Required. The text to add to the Output window.
Priority
Required. A vsTaskPriority constant representing the priority for the new task item.
SubCategory
Required. The subcategory to use for the new task item.
Icon
Required. A vsTaskIcon constant representing the icon to use for the new task item.
FileName
Required. The file name to associate with the new task item. Can be an empty string.
Line
Required. The line of code the new task item relates to.
Description
Required. The description of the new task item.
Force
Optional. Indicates whether the Output window should immediately update the Task List. The default value is True. If you are adding several items, set Force to False, and then set Force to True on the last item.

Example

Sub OutputTaskItemStringExample()
   ' Create a tool window handle for the Output window.
   Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
   ' Create handles to the Output window and its panes.
   Dim OW As OutputWindow = win.Object
   Dim OWp As OutputWindowPane

   ' Add a new pane to the Output window.
   OWp = OW.OutputWindowPanes.Add("A New Pane")
   ' Add a line of text to the new pane and to the Task List.
   OWp.OutputTaskItemString("Some task", vsTaskPriority.vsTaskPriorityHigh, vsTaskCategories.vsTaskCategoryMisc, vsTaskIcon.vsTaskIconComment, "C:\temp", 100, "Some description")
   ' You can also use the 'True' flag on the end of OutputTaskItemString 
   ' rather than using the next line (ForceItemsToTaskList).
   OWp.ForceItemsToTaskList()
End Sub

See Also

Applies To: OutputWindowPane Object

Show: