• Outlook User
  • Exchange Admin
  • Office 365
  • Outlook Developer
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
    • Common Problems
    • Outlook BCM
    • Utilities & Addins

Save New Contacts to iCloud Contacts

Slipstick Systems

› Outlook › People › Save New Contacts to iCloud Contacts

Last reviewed on December 17, 2020     2 Comments

Applies to: Outlook 2016 (Win), Outlook 2013, Outlook 2010, Outlook 2007

Although you can't save new contacts directly in the iCloud contacts folder unless you select the iCloud Contacts folder before opening the new Contact form, there are a couple of options available to move new contacts to the iCloud. First you can use the Move to Folder command instead of Save and Close. If you aren't familiar with the Move to folder command, instructions and a video tutorial are at Issues Syncing Outlook and iCloud Contacts.

The other option is a macro. Depending on how you typically create new contacts and if all new contacts belong in the iCloud, you can either use a macro to open a new contact form and set the Save to folder to the iCloud or use a macro that watches the default contacts folder and moves any new contacts to the iCloud. If you normally use the Add to Contacts option to create a contact for people who send you mail, there is a macro to mimic that feature too.

These macros aren't limited to just the iCloud. You can use them with any non-default contacts folder. You'll need to update the folder path though.

Either macro can easily be adapted for Calendars or Tasks.

Macro to Set the Save to Folder

If you mostly use the New Contact button when you need to save a new contact, this macro will work well for you. If you need to save some contacts to the default Contacts folder and some to the iCloud (or another contacts folder), you'll use this macro.

Paste the macro in a new Module then add it to the ribbon, next to the New items button, or Quick Access toolbar (QAT) for easy access.

Add the macro to a button

Public Sub CreateContactiCloud()

 Dim objContact As Outlook.ContactItem
 Set contactFolder = GetFolderPath("icloud\contacts")
 Set objContact = contactFolder.Items.Add(olcontactItem)
 objContact.Display

 End Sub

 Function GetFolderPath(ByVal FolderPath As String) As Outlook.Folder
     Dim oFolder As Outlook.Folder
     Dim FoldersArray As Variant
     Dim i As Integer
         
     On Error GoTo GetFolderPath_Error
     If Left(FolderPath, 2) = "\\" Then
         FolderPath = Right(FolderPath, Len(FolderPath) - 2)
     End If
     'Convert folderpath to array
     FoldersArray = Split(FolderPath, "\")
     Set oFolder = Application.Session.Folders.item(FoldersArray(0))
     If Not oFolder Is Nothing Then
         For i = 1 To UBound(FoldersArray, 1)
             Dim SubFolders As Outlook.Folders
             Set SubFolders = oFolder.Folders
             Set oFolder = SubFolders.item(FoldersArray(i))
             If oFolder Is Nothing Then
                 Set GetFolderPath = Nothing
             End If
         Next
     End If
     'Return the oFolder
     Set GetFolderPath = oFolder
     Exit Function
         
 GetFolderPath_Error:
     Set GetFolderPath = Nothing
     Exit Function
 End Function

 

Mimic 'Add to Contacts' Command

This version of the macro mimics the Add to Contacts command when you right-click on a sender's name in an email message. Add the macro to the ribbon or Quick Access Toolbar then select a message and run the macro.

This macro can be used in a module.

Sub CreateContactiCloud()
    Dim objContact As Outlook.ContactItem
    Dim objMail As Outlook.MailItem

Set objMail = Application.ActiveExplorer.Selection.Item(1)
 
 Set contactFolder = GetFolderPath("icloud\contacts")
 Set objContact = contactFolder.Items.Add(olContactItem)
    

With objContact
    .FullName = objMail.Sender
    .Email1Address = objMail.SenderEmailAddress
  
' if you want to add the selected email as an attachment 
    '.Attachments.Add objMail
   .Save
   .Display
End With
    
    Set objContact = Nothing
    Set objMail = Nothing
End Sub

 Function GetFolderPath(ByVal FolderPath As String) As Outlook.Folder
     Dim oFolder As Outlook.Folder
     Dim FoldersArray As Variant
     Dim i As Integer
         
     On Error GoTo GetFolderPath_Error
     If Left(FolderPath, 2) = "\\" Then
         FolderPath = Right(FolderPath, Len(FolderPath) - 2)
     End If
     'Convert folderpath to array
     FoldersArray = Split(FolderPath, "\")
     Set oFolder = Application.Session.Folders.Item(FoldersArray(0))
     If Not oFolder Is Nothing Then
         For i = 1 To UBound(FoldersArray, 1)
             Dim SubFolders As Outlook.Folders
             Set SubFolders = oFolder.Folders
             Set oFolder = SubFolders.Item(FoldersArray(i))
             If oFolder Is Nothing Then
                 Set GetFolderPath = Nothing
             End If
         Next
     End If
     'Return the oFolder
     Set GetFolderPath = oFolder
     Exit Function
         
GetFolderPath_Error:
     Set GetFolderPath = Nothing
     Exit Function
 End Function

Watch Default Contacts Folder Macro

If you mostly save Contacts by clicking on an address in an email message and choosing Save to contacts or drag email to the contacts folder, this macro will watch the default Contacts folder and move any contacts that are saved to the folder.

If you need to save some contacts to the default Contacts folder and some to the iCloud (or another contacts) folder, this macro won't work as it moves all contacts to the iCloud (or another) folder.

Task and Appointment versions of this macro can be found at "Save appointments to a non-default Outlook calendar folder".

Note: it uses the GetFolderPath Function in the macro above.

This macro needs to be in ThisOutlookSession.

Dim WithEvents newContact As Items
  
Private Sub Application_Startup()
   Dim NS As Outlook.NameSpace
   Set NS = Application.GetNamespace("MAPI")
   Set newContact = NS.GetDefaultFolder(olFolderContacts).Items
   Set NS = Nothing
End Sub
  
Private Sub newContact_ItemAdd(ByVal Item As Object)
Set ContactFolder = GetFolderPath("iCloud\Contacts")
Item.Move ContactFolder
End Sub

How to use the macro

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Macros that run when Outlook starts or automatically need to be in ThisOutlookSession, all other macros should be put in a module, but most will also work if placed in ThisOutlookSession. (It's generally recommended to keep only the automatic macros in ThisOutlookSession and use modules for all other macros.) The instructions are below.

Now open the VBA Editor by pressing Alt+F11 on your keyboard.

To use the macro code in ThisOutlookSession:

  1. Expand Project1 and double click on ThisOutlookSession.
  2. Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)

To put the macro code in ThisOutlookSession:

  1. Expand Project1 and double click on ThisOutlookSession.
  2. Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)

Application_Startup macros run when Outlook starts. If you are using an Application_Startup macro you can test the macro without restarting Outlook by clicking in the first line of the Application_Startup macro then clicking the Run button on the toolbar or pressing F8.

More information as well as screenshots are at How to use the VBA Editor.

More Information

More Outlook and iCloud articles at slipstick.com:

  • After Installing iCloud, Mail Won't Send?
  • Create a Task and copy to another Tasks folder
  • How to fix the iCloud APLZOD.dll error in Outlook
  • iCloud Add-in is not listed in Outlook Add-ins
  • iCloud and Outlook Problems: Syncing Calendar
  • iCloud and Outlook Repair Now error
  • iCloud Doesn't Sync
  • iCloud error: Outlook isn't configured to have a default profile
  • iCloud for Outlook 2016
  • iCloud is hijacking Meeting Invitations
  • iCloud, Outlook 2016, and Windows 10
  • Issues Syncing Outlook and iCloud Contacts
  • Outlook and iCloud Sync Issues
  • Outlook and iCloud: default data files
  • Outlook and iCloud: What you need to know
  • Outlook crashes when syncing iCloud calendars
  • Save appointments to a non-default Outlook calendar folder
  • Syncing iPhone Sent Messages with Outlook
  • Transfer POP3 Mail on an iPhone to Outlook

Save New Contacts to iCloud Contacts was last modified: December 17th, 2020 by Diane Poremsky
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Print

Related Posts:

  • Move Appointments to an Archive Calendar
  • Working with VBA and non-default Outlook Folders
  • Clean up the Junk Email folder
  • Use a Macro to Assign Messages in a Shared Mailbox

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
2 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

BCVolkert (@guest_217163)
November 10, 2020 11:06 am
#217163

Hi Diane,

I'm loving this site. There is soooo much good stuff here.

FYI: I believe olFolderContact should be olFolderContacts in the VBA for Sub Application_Startup().

Bruce

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  BCVolkert
November 10, 2020 11:33 am
#217164

OOPs. Thanks for catching that.

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 28 Issue 11

Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Subscribe to Exchange Messaging Outlook






Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • WeekMonthAll
  • Adjusting Outlook's Zoom Setting in Email
  • How to Remove the Primary Account from Outlook
  • Cannot add Recipients in To, CC, BCC fields on MacOS
  • Move an Outlook Personal Folders .pst File
  • Save Sent Items in Shared Mailbox Sent Items folder
  • Create rules that apply to an entire domain
  • Outlook's Left Navigation Bar
  • Use PowerShell to get a list of Distribution Group members
  • View Shared Calendar Category Colors
  • Remove a password from an Outlook *.pst File
  • Cannot add Recipients in To, CC, BCC fields on MacOS
  • Change Appointment Reminder Sounds
  • Messages appear duplicated in message list
  • Reset the New Outlook Profile
  • Delete Old Calendar Events using VBA
  • Use PowerShell or VBA to get Outlook folder creation date
  • Outlook's Left Navigation Bar
  • Contact's Display Bug
  • Use PowerShell to get a list of Distribution Group members
  • Edit Outlook’s Attach File list
Ajax spinner

Newest Code Samples

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Format Images in Outlook Email

Set Outlook Online or Offline using VBScript or PowerShell

List snoozed reminders and snooze-times

Search your Contacts using PowerShell

Filter mail when you are not the only recipient

Add Contact Information to a Task

Process Mail that was Auto Forwarded by a Rule

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Outlook Links Won’t Open In Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook Top Issues

  • The Windows Store Outlook App
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

Outlook-tips.net Samples

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

MSDN Outlook Dev Forum

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Diane Poremsky [Outlook MVP]

Make a donation

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Outlook Suggestion Box (UserVoice)

Slipstick Support Services

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Advertise | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2023 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment