Access.2007.VBA.Bibl..

(John Hannent) #1
As an example, the Microsoft record in my personal Access Contacts database has 30 phone num-
bers, many with non-standard descriptions — I couldn’t do that in Outlook!

However, despite the advantages of a relational database, Outlook is undeniably attractive and con-
venient, so much so that you may want (or need) to export your Access contact data to Outlook
contact items, so you can quickly look up a phone number or email address (or at least those that
correspond to standard Outlook slots). And if you have tasks or calendar items stored in an Access
table (perhaps created before Office 97), you may wish to permanently move them to Outlook,
which offers a superior interface for working with these types of items.

See Chapter 11 for a detailed treatment of synchronizing a set of linked Access tables
with matching Outlook contacts.

Exporting Access Data to Outlook Items ..........................................................................


Apart from exporting whole contact, task, or appointment records to Outlook, you may need to
create new Outlook items on the fly, as the data in your Access tables changes, using code running
from event procedures or macros. For example, if you have a database of project-related informa-
tion, you can create project task reminders in the form of email messages filled with data from
an Access table, or Outlook tasks or appointments triggered by changes in data stored in the
Access tables.

You can use the legacy SendObjectcommand to create email messages (it’s in some of the
embedded macros on the forms imported from the new Microsoft sample databases discussed later
on in the chapter), but SendObjectonly allows you to set a few properties of a standard Outlook
mail message, and thus won’t do the job if you need to create a mail message based on a custom
form, or you want to set built-in properties that are not arguments of the SendObjectcommand.

Alternatively, the Export group on the External Data tab of the new Ribbon offers many choices for
exporting Access data, but curiously, as you can see in Figure 8.1, there is no selection for export-
ing to Outlook.

Using the Collect Data Group ..................................................................................


In Access 2007, there is a new choice for interacting with Outlook: The Collect Data group on the
External Data tab of the Ribbon has two buttons, one to create emails for gathering data to import
into Access tables and the other to manage the replies (see Figure 8.2).

CROCROSSSS-REF-REF


Part II Writing VBA Code to Exchange Data between Office Components

Free download pdf