![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
Is there a way to get the Email address list from Outlook and input to a Combo control using Ac2003? Thanks in advance |
#2
|
|||
|
|||
![]()
Am 04.06.2010 20:42, schrieb Abe Katz:
Hello, Is there a way to get the Email address list from Outlook and input to a Combo control using Ac2003? Thanks in advance Well you could insert your contact data into a table. I wrote a code for that. Sub GetOutlookContacts() Dim outWorkspace As Object Dim appOut As New Outlook.Application Dim objKon As Object Dim intz As Integer Dim strName As String Dim strFirstname As String Dim strMail As String Dim rst As New ADODB.Recordset Dim conn As ADODB.Connection On Error GoTo mistake Set conn = CurrentProject.Connection rst.Open "SELECT * FROM tblMailadress", conn, adOpenKeyset, adLockOptimistic Set outWorkspace = _ appOut.GetNamespace("MAPI").GetDefaultFolder(olFol derContacts) 'clear table CurrentDb.Execute "DELETE * FROM tblMailadress", 128 'dbFailOnError 'fill table For intz = 1 To outWorkspace.Items.Count Set objKon = outWorkspace.Items(intz) strName = objKon.LastName strFirstname = objKon.FirstName strMail = objKon.Email1Address rst.AddNew rst!LastName = strName rst!FirstName = strFirstnamename rst!Email = strMail rst.Update Next intz rst.Close conn.Close Set objKon = Nothing Set appOut = Nothing Set conn = Nothing Set rst = Nothing Exit Sub mistake: MsgBox Err.Number & " " & Err.Description End Sub I hope this will help you! Regards Jörn |
Thread Tools | |
Display Modes | |
|
|