Results 1 to 3 of 3

Thread: OutLook Contacts

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    OutLook Contacts

    Hi!
    Need Access to OutlookContacts from VB?
    In Public folders??
    Any ideas?

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    You can do things like:

    set OL = GetObject(,"OUTLOOK.APPLICATION")
    set MAPI = OL.GetNamespace("MAPI")
    Set myItems = MAPI.GetDefaultFolder(10).Items

    where the default folder number 10 is Contacts (Or call it olFolderContacts).

    Ot you can select folders and move down the levels if you need to look into the Public Folders area. Something like (although this is a .VBS script file):
    VB Code:
    1. Set WshShell = WScript.CreateObject("WScript.Shell")
    2. set OL = GetObject(,"OUTLOOK.APPLICATION")
    3. set myMAPI = OL.GetNamespace("MAPI")
    4. Set myStore = myMAPI.Folders("Public Folders")
    5. Set myItems = myStore.Folders("Company Contacts")
    6. MsgBox "Looking at " & myItems.Items.Count & " items"

  3. #3
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    There are also Outlook Objects you can reference in your project. They're really easy to work with, although there's some technique you need defining namespaces.

    Here's an MSDN article with some sample code:

    http://support.microsoft.com/default...b;en-us;220595
    end war
    stop greed

Posting Permissions

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



Click Here to Expand Forum to Full Width