Outlook Integration

  • Thread starter Thread starter grep
  • Start date Start date
G

grep

I'm creating an application to manage client service contracts. I always
enter client information into Outlook, and would like to avoid having to
enter the same client information three times. (Yes, three times - I've
already resigned myself to having to enter the information in QuickBooks
manually.) I'd like to be able to click a button on my Access Client
Form, have it bring up my Outlook Contact List, and then autofill my
Client Form fields based on my Contact List selection.

I'm sure this is possible, but I have no clue as to how to go about it.
Any pointers?

grep
 
1. Click on File > get external data > link tables

2. In "Files of type", choose "Outlook()"

3. Select the contacts folder from the browser tree and click Next>

4. Change the name for the local table if required, and click Finish

You can now access your contacts just as you would any other table.

On the QuickBooks problem: I know nothing about QuickBooks, but a quick
Google for /QuickBooks ODBC "Microsoft Access"/ suggests that there are ways
to connect directly from Access to QuickBooks. You might like to start with
this link:
http://www.qodbc.com/qodbcaccess.htm
 
Function ExportAccountToOutlook(AccountID As Long) As Boolean
On Error GoTo ErrHandler
' Set up DAO Objects.
Dim oDataBase As Database
Dim rst As Recordset
Set oDataBase = DBEngine(0)(0)
Set rst = oDataBase.OpenRecordset("SELECT * FROM Accounts" _
& " WHERE AccountID=" & AccountID, dbOpenSnapshot)

' Set up Outlook Objects.
Dim ol As New Outlook.Application
Dim olns As Outlook.Namespace
Dim cf As Outlook.MAPIFolder
Dim c As Outlook.ContactItem
Dim Prop As Outlook.UserProperty

Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olFolderContacts)

If Not rst.EOF Then
With rst
' Create a new Contact item.
Set c = ol.CreateItem(olContactItem)

' Specify which Outlook form to use.
' Change "IPM.Contact" to "IPM.Contact.<formname>" if you've
' created a custom Contact form in Outlook.
c.MessageClass = "IPM.Contact"

' Create all built-in Outlook fields.
c.FullName = !FirstName & " " & !LastName
c.FirstName = ![FirstName]
c.LastName = ![LastName]
c.HomeAddressStreet = !StreetAddress
c.HomeAddressCity = !City
c.HomeAddressState = !State
c.HomeAddressPostalCode = !ZIP
If !TelephoneA <> "" Then c.HomeTelephoneNumber = !TelephoneA
If !TelephoneB <> "" Then c.BusinessTelephoneNumber = !TelephoneB
If !Mobile <> "" Then c.MobileTelephoneNumber = !Mobile
If !Email <> "" Then c.Email1Address = !Email
c.Categories = "Account"
' Create the first user property (UserField1).
Set Prop = c.UserProperties.Add("AccountID", olText)

' Set its value.
Prop = ![AccountID]

' Save the contact.
c.Save
ExportAccountToOutlook = True
End With
End If

ExitHere:
On Error Resume Next
rst.Close
Set rst = Nothing
Set c = Nothing
Set olns = Nothing
Set cf = Nothing
Set oDataBase = Nothing
Exit Function
ErrHandler:
MsgBox Err.Description & " " & Err.Number
ExportAccountToOutlook = False
Resume ExitHere

End Function

Enjoy...

Graham Mandeno said:
1. Click on File > get external data > link tables

2. In "Files of type", choose "Outlook()"

3. Select the contacts folder from the browser tree and click Next>

4. Change the name for the local table if required, and click Finish

You can now access your contacts just as you would any other table.

On the QuickBooks problem: I know nothing about QuickBooks, but a quick
Google for /QuickBooks ODBC "Microsoft Access"/ suggests that there are ways
to connect directly from Access to QuickBooks. You might like to start with
this link:
http://www.qodbc.com/qodbcaccess.htm
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


grep said:
I'm creating an application to manage client service contracts. I always
enter client information into Outlook, and would like to avoid having to
enter the same client information three times. (Yes, three times - I've
already resigned myself to having to enter the information in QuickBooks
manually.) I'd like to be able to click a button on my Access Client Form,
have it bring up my Outlook Contact List, and then autofill my Client Form
fields based on my Contact List selection.

I'm sure this is possible, but I have no clue as to how to go about it.
Any pointers?

grep
 
Back
Top