Results 1 to 5 of 5
  1. #1
    kevinrea is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    3

    Access 2010: Create contact in Outlook 2010

    HI Guys,


    the following code I use works fine in access 2003, but not in access 2010.
    I have looked all over the internet for help, but I could not find the answer myself,
    so I am asking it here.
    Here is the code that works for creating a new contact in outlook 2010 from access 2003:
    ************************************************** ************************
    Private Sub TransferRealtortooutlookbutton_Click()

    Dim olApp As New Outlook.Application
    Dim olContact As Outlook.ContactItem

    If ContactExists(olApp, Nz(Me![REAgentName], "")) Then
    Beep
    MsgBox "That Realtor is already in your Outlook Contact List"
    Exit Sub
    ElseIf MsgBox(" Add this Realtor to the contacts in MS Outlook ?", vbYesNo, "Delete") = vbYes Then


    Set olContact = olApp.CreateItem(olContactItem)
    With olContact
    .FullName = Nz(Me![REAgentName], "")
    .BusinessAddressCity = Nz(Me![Address1] & " - " & Me![City], "")
    .BusinessAddressState = Nz(Me![State], "")
    .BusinessAddressPostalCode = Nz(Me![ZipCode], "")
    .BusinessTelephoneNumber = Nz(Me![Phone], "")
    .Email1Address = Nz(Me![Email], "")
    .BusinessFaxNumber = Nz(Me![Fax], "")
    .MobileTelephoneNumber = Nz(Me![CellPhone], "")
    .HomeTelephoneNumber = Nz(Me![OtherPhone], "")
    .JobTitle = "Realtor From EZ Inspection Database - " & Nz(Me![Notes] & " Inspection #: " & Nz(Me![inspection#], ""))
    .CompanyName = Nz(Me![CompanyName], "") & "- Insp Add: " & Forms![inspectionmain]![Address1] & " - " & Forms![inspectionmain]![City] & " - " & Forms![inspectionmain]![State]
    .Body = Nz(Me![Notes], "") & " :" & Me.email2
    .WebPage = Nz(Me![Website], "")
    .Save
    End With
    Beep
    MsgBox " Contact Saved to Outlook."
    Else
    End If

    End Sub
    ************************************************** *************

    thanks very much,
    kevin rea
    Lancaster, calif.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I tested code with Access 2010. The new contact record was not added when Outlook was closed even though the code ran without error. The record did add when Outlook was already open.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    kevinrea is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    3
    thanks super moderator..
    but, I have outlook opened and it does not work.

    kevin

  4. #4
    kevinrea is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    3
    I figured it out folks..I also had access 2000 and access 2003 installed on my system.
    I removed them and reinstalled office 2010 with access 2010, rebooted the system.
    It now works perfectly.
    thanks,
    Kevin Rea

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    So the contact record adds when Outlook is closed?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Import Outlook Department field Access 2010
    By jeanbot in forum Import/Export Data
    Replies: 2
    Last Post: 07-18-2013, 03:06 AM
  2. Contact Tracking database design - Access 2010 non-web
    By Third Person in forum Database Design
    Replies: 1
    Last Post: 03-19-2013, 02:41 PM
  3. Importing Outlook 2010 folders into Access
    By the_chomp in forum Access
    Replies: 3
    Last Post: 01-22-2013, 06:02 PM
  4. Change layout on access 2010 contact database.
    By trumpetman in forum Access
    Replies: 0
    Last Post: 06-18-2012, 05:02 AM
  5. VBA - Import Outlook contacts to access 2010
    By snoopy2003 in forum Programming
    Replies: 2
    Last Post: 11-12-2011, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums