Consulting

Results 1 to 5 of 5

Thread: VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder

  1. #1

    VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder

    Hello,

    I have make a script for copy a contact list to a contact list in the public folder but if i'm not on the contact source , the macro don't work, i don't know why, thx.


    I things the error come from:
    Set objItem = Application.ActiveExplorer.Selection.Item(1)


    Sub Movecopycontacts()

    Dim objOutlook As Outlook.Application
    Dim objNamespace As Outlook.NameSpace
    Dim objSourceFolder As Outlook.MAPIFolder
    Dim objDestFolder As Outlook.MAPIFolder
    Dim objItem As ContactItem

    Set objOutlook = Application
    Set objNamespace = objOutlook.GetNamespace("MAPI")
    Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderContacts)
    Set objItem = Application.ActiveExplorer.Selection.Item(1)
    Set objDestFolder = objNamespace.Folders("Public folder - test.com").Folders("all public folder").Folders("test")

    objItem.Move objDestFolder

    Set objDestFolder = Nothing
    End Sub

  2. #2
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    thx a lot

  4. #4
    Veryuseful link!

  5. #5
    As I may see it is solved now, I only wanted suggest you a good way for it. I used the export mac mail to outlook more details and others fetures are described on that page. But thanks to advices above, they are useful too. Besides I was searched this solving for my problem, for long, surfing on the blogs and others forums, I was lucky to find this way. So I just wanted to share this finding in case if somebody like me, will search this as well. My job maded me to look for it, and I'm pretty hapy that I found such a thing. For me now is useful not only for work, but for private emails export as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •