![]() |
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 | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Greetings all! And thanks for s-o-o many fine solutions over the years.
Unfortunately, with hours of searching, I can't achieve success. Background: Access 2003 & Outlook 2003 Pro SP2, running XP Pro The Outlook contacts reside on a third-party-hosted Exchange server. I am seeking a customer solution that will enable an Access DB to link dynamically to a contacts folder named "TeetersCustomerContacts in 'Public Folders' under 'All Public Folders' under a 'TPI" folder'. eg: Public Folders| All Public Folders/TPI/TeetersCompanyContacts The following code connects (or at least does not break). QUESTIONS: 1) How do I populate a recordset using 'TeetersCompanyContacts'? 2) How do I create a table (ideally a temp table?) of this data? Thank you so much for any assistance. Brian M ------------------------- Sub OpenExchange_CompanyContacts() Dim ADOConn As ADODB.Connection Dim ADORS As ADODB.Recordset Dim strConn As String '====== Using as test code only to confirm the nested folder names are correct Dim ns As Outlook.NameSpace Dim fld As Outlook.MAPIFolder Dim myOutlook As Outlook.Application Set myOutlook = New Outlook.Application Set ns = myOutlook.GetNamespace("MAPI") For Each fld In ns.Folders("Public Folders").Folders("All Public Folders").Folders("TPI").Folders("TeetersCompanyCo ntacts").Folders Debug.Print fld.Name Next 'myOutlook.Quit 'Set myOutlook = Nothing '====== End test of folder names Set ADOConn = New ADODB.Connection Set ADORS = New ADODB.Recordset With ADOConn .Provider = "Microsoft.JET.OLEDB.4.0" .ConnectionString = "Exchange 4.0;" _ & "MAPILEVEL=Public Folders|All Public Folders\TPI\TeetersCompanyContacts;PROFILE=Test;TA BLETYPE=0;DATABASE=C:\TEMP\" _ & "PROFILE=MS Exchange Settings;" _ & "TABLETYPE=0;DATABASE=C:\WINDOWS\TEMP\;" .Open End With ' With ADORS ' .Open "Select * from TeetersCompanyContacts;", ADOConn, adOpenStatic, _ ' adLockReadOnly ' .MoveFirst ' Debug.Print ADORS(3).Name, ADORS(3).Value ' Debug.Print ADORS(10).Name, ADORS(10).Value ' .Close ' End With Set ADORS = Nothing ADOConn.Close Set ADOConn = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Public Folder Contacts not appearing | [email protected] | Outlook - General Queries | 3 | February 24th 06 10:55 AM |
Table View Contacts Gridline | lopnorth | Outlook - General Queries | 0 | February 23rd 06 03:56 PM |
Cannot search contacts in public folder | jaff | Outlook - Using Contacts | 0 | January 11th 06 06:20 PM |
public contacts folder in favorites is empty | rcolving | Outlook - Using Contacts | 0 | January 10th 06 03:38 PM |
Making the Public Folder Contacts the Primary Contacts?? | Roman B. | Outlook - Using Contacts | 1 | January 9th 06 10:52 AM |