Access.2007.VBA.Bibl..

(John Hannent) #1

Exporting Journal Information to Outlook ..........................................................................


If you link to or import mainframe transaction or batch processing data into an Access database
table, it may be convenient to export that data to Outlook journal items, for quick reference in the
Outlook interface. The table tblMainframeData in the sample database is an example of such data.
Figure 4.5 shows a portion of this table, with the fields to be exported to Outlook.

FIGURE 4.5

A table of mainframe data to export to Outlook journal items.


The function that exports the mainframe data to Outlook journal items is listed as follows (for con-
venience, this function is run from the macro mcrExportTransactions):

Public Function ExportTransactions()

On Error GoTo ErrorHandler

Dim appOutlook As Outlook.Application
Dim jnl As Outlook.JournalItem
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strBody As String
Dim strPrompt As String
Dim strTitle As String

Set appOutlook = GetObject(, “Outlook.Application”)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblMainframeData”)
Do While Not rst.EOF
Set jnl = appOutlook.CreateItem(olJournalItem)

Organizing and Communicating with Outlook 4

Free download pdf