none
After adding a Column in MsProject from Vb.net, how we can insert data RRS feed

  • Question

  • Hi,

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

    appclass.TableEdit(Name:=

    "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)

    appclass.TableApply(Name:=

    "Entry")

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

    For

     

    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)

    next

    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