Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
Outlook Shared Contacts copied to MyContacts

I am trying to copy Outlook Shared Contacts into a folder under MyContacts. I am looking for an easy solution for my team outside of using an Import Wizard or physically copy/paste due to the computer challenged. I have been successful in doing this from MyContacts/Contacts to MyContacts/Another_Folder but can't seem to copy from a Shared Contact folder.

I am running a macro from Excel so that all users can just run the Excel macro and it will modify their Outlook instead of having everyone Allow macros in Outlook.

Current running code is here:

Sub CopyContacts()

Dim ContactItem As Outlook.ContactItem
Dim Name As Outlook.Namespace
Dim Folder As Outlook.Folder
Dim Item As Object

Set Name = Outlook.GetNamespace("MAPI")


Set Folder = Name.GetDefaultFolder(olFolderContacts)

    For Each Item In Folder.Items

        If Item.Class = olContact Then

        Set ContactItem = Item.Copy
        ContactItem.Move Folder.Folders("Another_Folder")

        End If

    Next

End Sub

I would like to run an Excel Macro to copy all the contents from Shared Contacts John Doe's folder to Another_Folder.

Outlook Contact Folder Structure

I would be great if the Macro deleted all the contents from Another_Folder before the copy function.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use the NameSpace.GetSharedDefaultFolder method which returns a Folder object that represents the specified default folder for the specified user. This method is used in a delegation scenario, where one user has delegated access to another user for one or more of their default folders (for example, their shared Calendar folder).

Sub ResolveName() 
 Dim myNamespace As Outlook.NameSpace 
 Dim myRecipient As Outlook.Recipient 
 Dim CalendarFolder As Outlook.Folder 
 
 Set myNamespace = Application.GetNamespace("MAPI") 
 Set myRecipient = myNamespace.CreateRecipient("John Doe") 
 myRecipient.Resolve 
 If myRecipient.Resolved Then 
  Call ShowContacts(myNamespace, myRecipient) 
 End If 
End Sub 
 
Sub ShowContacts(myNamespace, myRecipient) 
 Dim ContactsFolder As Outlook.Folder 
 
 Set ContactsFolder = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderContacts) 
 
 ContactsFolder.Display 
 
End Sub
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!