Results 1 to 2 of 2

Thread: Loop thru GAL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    124

    Loop thru GAL

    How do I obtain the GAL, and then loop thru it.

    Dim myOlApp As Outlook.Application
    Dim myItem As Outlook.MailItem
    Dim myRecipient As Outlook.Recipient
    Dim myGAL as i dont know what
    Dim strUser as String


    myOlApp = CreateObject("Outlook.Application")
    myItem = myOlApp.CreateItem Outlook.OlItemType.olMailItem)
    myRecipient = myItem.Recipients.Add(strUser)
    myGAL = ???????????????


    thanks duders

    db

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    124

    Lightbulb

    i figured it out

    heres the code


    Dim myOlApp As Outlook.Application
    Dim myItem As Outlook.MailItem
    Dim myRecipient As Outlook.Recipient
    Dim myGAL As Outlook.NameSpace
    Dim myLists As Outlook.AddressLists
    Dim myList As Outlook.AddressList
    Dim i As Integer

    myOlApp = CreateObject("Outlook.Application")
    myItem = myOlApp.CreateItem(Outlook.OlItemType.olMailItem)
    myRecipient = myItem.Recipients.Add("briandda")
    myGAL = myOlApp.GetNamespace("MAPI")
    myLists = myGAL.AddressLists()

    For i = 1 To myLists.Count - 1
    myList = myLists.Item(i)
    If myList.Name = "Global Address List" Then
    do whatever
    End If
    Next

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