NextContact:
Next varItem
ErrorHandlerExit:
Set appOutlook = Nothing
Exit Sub
ErrorHandler:
Outlook is not running; open Outlook with CreateObject.
If Err.Number = 429 Then
Set appOutlook = CreateObject(“Outlook.Application”)
Resume Next
Else
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End If
End Sub
You may have contacts that have only an email address, or a phrase like “Tech. Support”
entered as the last name, or contacts with just a first name, or a whole name entered
into the LastName field, or sets of contacts who work for the same company, where the company
name is entered differently on different contact records. Importing from such contacts can cause
problems, such as creating multiple Company records with variations of a company name.
I am planning to upgrade the Synchronizing Contacts database to deal with various types of problem
data, and to add some new features; look for an updated version of the database on my Web site,
http://www.helenfeddema.com.
Summary ..........................................................................................................................
This chapter dealt with exporting to, and importing from, a variety of file formats, ranging from the
oldest formats to those so new that they are scarcely useful yet. Text files, both comma-delimited
and fixed-width (columnar), have been used for data export and import since the earliest days of
computers, and they are still very useful, especially the comma-delimited file format. Files
exported to this format can be imported by a great many applications, which makes it very useful
for exporting data that is to be imported by an application not directly supported as an Access
export type. The reverse is also true: many applications can export their data to a fixed-width or
comma-delimited file, from which they can be imported into Access tables.
If you have data in ancient dBASE, Paradox, or Lotus files, Access offers options for importing from
these files, so you can get your old data into Access tables. Although it isn’t likely to be required
these days, you can also export data from Access tables to these legacy formats.
And finally, the new HTML and XML formats are supported — but not very well. These import and
export types still have little utility for importing data into Access tables, either because they simply
don’t work or because they aren’t really relevant. Hopefully, these file formats will be better sup-
ported for Access import and export in future versions of Office.
NOTENOTE
Part II Writing VBA Code to Exchange Data between Office Components