i får lige min kode. Det jeg ønsker er at tilføje en kollonne med checkboxe i mit datagrid
Private Sub test2() Dim strFrom As String Dim strSubject As String Dim strBody As String Dim APP = CreateObject("Outlook.Application") Dim ns = APP.GetNamespace("MAPI") Dim OLF = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) Dim EmailItemCount = OLF.Items.Count Dim i As Int16 = 1 Dim intAntalSlettes As Int16 = 0
Dim Table1 As DataTable Table1 = New DataTable("EmailHandling") 'creating a table named Customers Dim Row1, Row2, Row3, row4 As DataRow 'declaring three rows for the table
Dim From As DataColumn = New DataColumn("From") 'declaring a column named Name From.DataType = System.Type.GetType("System.String") 'setting the datatype for the column Table1.Columns.Add(From) 'adding the column to table Dim Subject As DataColumn = New DataColumn("Subject") Subject.DataType = System.Type.GetType("System.String") Table1.Columns.Add(Subject) Dim Body As DataColumn = New DataColumn("Body") Body.DataType = System.Type.GetType("System.String") Table1.Columns.Add(Body)
If (strBody.IndexOf("This account has been closed") <> -1) Then Row1 = Table1.NewRow() 'declaring a new row Row1.Item("From") = strFrom 'filling the row with values. Item property is used to set the field value. Row1.Item("Subject") = strSubject 'filling the row with values. adding a product Row1.Item("Body") = strBody 'filling the row with values. adding a location Table1.Rows.Add(Row1) 'adding the completed row to the table
intAntalSlettes += 1
End If
End With
EmailItemCount = EmailItemCount - 1 End While
Dim ds As New DataSet() ds = New DataSet() 'creating a dataset ds.Tables.Add(Table1) 'adding the table to dataset DataGrid1.SetDataBinding(ds, "EmailHandling") 'binding the table to datagrid
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.