Hallo zusammen,
Ist es möglich statt direkt das DGV zu befüllen über eine Bindingsource das DGV zu füllen?
Da ich die Daten noch Filtern ect. möchte währe dies einfacher.
danke
Ist es möglich statt direkt das DGV zu befüllen über eine Bindingsource das DGV zu füllen?
Da ich die Daten noch Filtern ect. möchte währe dies einfacher.
VB.NET-Quellcode
- Dim p() As Process = Process.GetProcessesByName("Outlook")
- If p.Length = 0 Then
- Dim ExterneAnwendung As New System.Diagnostics.Process()
- ExterneAnwendung.StartInfo.FileName = "outlook.exe"
- ExterneAnwendung.Start()
- End If
- ' Create Outlook application.
- Dim oApp As Outlook.Application = New Outlook.Application()
- Dim contact As Object
- ' Get NameSpace and Logon.
- Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
- oNS.Logon("Outlook", Missing.Value, False, True)
- Dim oContacts As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
- Dim oItems As Outlook.Items = oContacts.Items
- Dim oAppt As Outlook.ContactItem = oContacts.Items.GetNext
- Dim contactscounter = oContacts.Items.Count
- Dim i As Integer
- 'For Each Contact In oItems
- For Each Contact1 As Outlook.ContactItem In oItems
- ' If Contact1.FileAs = "" Then
- ' Else
- DataGridView1.Rows.Add(Contact1.FileAs, Contact1.FirstName, Contact1.LastName, Contact1.BusinessTelephoneNumber, _
- Contact1.MobileTelephoneNumber, Contact1.HomeTelephoneNumber)
- ' kontakte.ListBox1.Items.Add( "Contact1.HomeTelephoneNumber & "*" & Contact1.LastName & "=" & Contact1.FirstName & "]")
- ' End If
- Next
- ' Log off.
- oNS.Logoff()
- ' Clean up.
- oApp = Nothing
- oNS = Nothing
- oItems = Nothing
- oAppt = Nothing
danke