This documentation is archived and is not being maintained.

FileName Property

Visual Studio .NET 2003

Sets or returns a string representing the filename that was passed to the Task List window when the task item was created.

Property Get FileName () As String
Property Let FileName (
 FileName As String


Indicates the file or path associated with the new task item. The default value is an empty string (""). The file name can be a full path name, a relative path name, or simply a file name.


Sub FilenameExample()
   ' Before running, add a task to the Task List.
   Dim win As Window = DTE.Windows.Item(Constants.vsWindowKindTaskList)
   Dim TL As TaskList = win.Object
   Dim TLItem As TaskItem = TL.TaskItems.Item(1)
   Dim msg As String

   'List properties of the Task Item.
   msg = "TaskItem Category property value: " & TLItem.Category & vbCr
   msg = msg & "TaskItem SubCategory property value: " & TLItem.SubCategory & vbCr
   msg = msg & "TaskItem Checked property value: " & TLItem.Checked & vbCr
   msg = msg & "TaskItem Displayed property value: " & TLItem.Displayed & vbCr
   ' The following line will fail with an error unless a file is 
   ' associated with the Task Item.
   msg = msg & "TaskItem Filename property value: " & TLItem.FileName & vbCr
   msg = msg & "TaskItem IsSettable property value: " & TLItem.IsSettable(vsTaskListColumn.vsTaskListColumnCheck) & vbCr
   msg = msg & "TaskItem Priority property value: " & TLItem.Priority & vbCr
End Sub

See Also

Applies To: TaskList Object