Consulting

Results 1 to 6 of 6

Thread: Import and Export Contacts

  1. #1
    Administrator
    VP-Knowledge Base
    VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location

    Import and Export Contacts

    How could I import and export my contacts using a macro?
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi Carlos

    I'm not sure about this... I know it's easy to import a PST into your Outlook namespace [VBA]Sub ImportPST()

    Dim olNS As NameSpace

    Set olNS = GetNamespace("MAPI")
    olNS.AddStore "C:\My Documents\MyContacts.pst"

    End Sub
    [/VBA]but exporting is different...
    I think you may have to iterate through the Contact items, get the properties and pass them to an export file - easy if you want to export to Excel or text of some kind, but I don't know how to make a PST
    K :-)

  3. #3
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi Killian,

    great you already solved 50% and this helps me a lot, now I just wait for someone else to help me on the other 50%, because I am having some trouble on making that pst.
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  4. #4
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi Killian,

    the import worked great, so now my problem is to export the messages for a text file AND a pst.
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  5. #5
    Hi Carlos, Don't know if this would be of any use to you but I suggest you take a look..

    http://msdn.microsoft.com/library/de...ddressexpt.asp

  6. #6
    Administrator
    VP-Knowledge Base VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Great BexleyManor,

    yes, it helped a lot. Thanks.
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

Posting Permissions

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