After adding a Column in MsProject from, how we can insert data RRS feed

  • Question

  • Hi,

    I added one column 'Site Name' in MsProject using using the following code.


    "Entry", TaskTable:=True, NewName:="", FieldName:="", NewFieldName:="Text1", Title:="Site Name", Width:=50, Align:=2, ShowInMenu:=True, LockFirstColumn:=False, DateFormat:=255, RowHeight:=1, ColumnPosition:=1, AlignTitle:=1)



    Now the problem is, i want to display data in the above column from application, i used the following code



    i = 0 To

    ds.Tables(0).Rows.Count - 1

    project.Text1.Insert(i, ds.Tables(0).Rows(i).Item(1).ToString())

    project.Resources.Add(ds.Tables(0).Rows(i).Item(4).ToString(), i + 1)


    but it gives me error in first line of the for loop that is highlighted bold "Index was out of range. Must be non-negative and less than the size of the collection"

    There is no problem with second line of for loop, it is adding Resources data without any problem.

    Anybody can help me please.

    • Moved by Cindy Meister MVP Monday, September 19, 2011 9:19 AM Project, not VSTO-related (From:Visual Studio Tools for Office)
    Monday, September 19, 2011 8:35 AM

All replies