FIGURE 11.9An Outlook Select Folder dialog for selecting the Contacts folder for synchronizing.
Re-creating the Flat-file Tables of Access and Outlook Data ....................................
If you have recently entered new contact data or modified existing contact records, either in Access
or Outlook, click Yes to refresh the data in the tables that will be compared. Clicking Yes calls two
procedures that clear tblOutlookContacts and tblAccessContacts and fill them with up-to-date
data. The ImportOutlookContactsprocedure (listed next) is simpler: it copies data from all
the contact items in the selected folder to records in tblOutlookContacts:Public Function ImportOutlookContacts()
‘Called from cmdForms_Click on fmnuMainOn Error GoTo ErrorHandlerSet appOutlook = GetObject(, “Outlook.Application”)Dim fldContacts As Outlook.Folder
Dim con As Outlook.ContactItem
Dim strSQL As String
Dim strTable As StringSet appOutlook = GetObject(, “Outlook.Application”)
Set nms = appOutlook.GetNamespace(“MAPI”)Set a variable to the Contacts folder to use when synchronizing:Use the following lines to import from the default local Contacts folder.‘Set fldContacts = nms.GetDefaultFolder(olFolderContacts)
‘GoTo ImportDataSynchronizing Access and Outlook Contacts 11