Avatar of Todd9
Todd9

asked on 

In Access 2016 it has a macro action called "save as oulook contact"

In Access 2016 it has a macro action called "SaveAsOutlookContact", any advice on how I can use this action to save Access 2016 contact fields into Outlook 2016?
Microsoft Access

Avatar of undefined
Last Comment
PatHartman
Avatar of PatHartman
PatHartman
Flag of United States of America image

Run the macro?

I'm sure I am missing something in your question but i don't have enough information to provide a better answer.
Avatar of Todd9
Todd9

ASKER

I am using Microsoft Access 2016, and I have a table in Access with my Contact records. I am wondering of I can use the Macro action in Access called "SaveAsOutlookContact", to copy those contact records and then save/and or update my contact records in Microsoft Outlook 2016.

I do not want to just import my list, I would like to create a macro that each time a new contact is created ( or edited)  in Access, it would create a new contact in Outlook, or update the contact in Outlook

My goal would be to take my contacts in MS Access and sync them with my contacts in Outlook.
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Todd9
Todd9

ASKER

Thanks for the assistance.

Todd
Avatar of PatHartman
PatHartman
Flag of United States of America image

That macro was meant to be used on a contacts "Form"
I can't imagine how you figured this out.  Access help disavows any knowledge of the macro.

Here is some code that might be useful.
Function AddOlContact()
On Error GoTo Error_Handler
  Const olContactItem = 2
  Dim olApp As Object
  Dim Ctct As Object
 
  Set olApp = CreateObject("Outlook.Application")
  Set olContact = olApp.CreateItem(olContactItem)
 
  With olContact
    .FirstName = "Daniel"
    .LastName = "Alba"
    .JobTitle = ""
    .CompanyName = "MINI CARDA"
    .BusinessAddressStreet = "22 ClearPoint"
    .BusinessAddressCity = "Pointe-Claire"
    .BusinessAddressState = "Quebec"
    .BusinessAddressCountry = "Canada"
    .BusinessAddressPostalCode = "H9X 3A6"
    .BusinessTelephoneNumber = "(514) 488-0956"
    .BusinessFaxNumber = ""
    .Email1Address = "mini@mini.com"
    .MobileTelephoneNumber = ""
    .Save 'use .Display if you wish the user to see the contact pop-up
  End With
 
Error_Handler_Exit:
  On Error Resume Next
  Set olContact = Nothing
  Set olApp = Nothing
  Exit Function
 
Error_Handler:
  MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & _
  Err.Number & vbCrLf & "Error Source: AddOlContact" & vbCrLf & "Error Description: " & _
  Err.Description, vbCritical, "An Error has Occured!"
  Resume Error_Handler_Exit
End Function

Open in new window

Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo