Results 1 to 2 of 2

Thread: Mapi Address Book

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Location
    NZ
    Posts
    1

    Post

    Does anybody know how to access the Mapi address book. I am using the mapi session and message controls in a vb5 project. I can load up the address book, but how do I access the selected recipients ??

    Thanks

  2. #2
    New Member
    Join Date
    Jul 1999
    Posts
    2

    Post

    I use VB6 so I'm not for sure how it will work in VB5. Try this Function, where pName can either be "" or a partial name.

    MailLogOn is a subroutine that verifies that the MAPI session is connected.

    I hope this helps you.


    Public Function GetAddressBook(pName) As String
    Dim response As Integer
    'Check if mail server is logged on already
    MailLogOn

    If pName = "" Then
    pName = " "
    End If

    'Check names versus names in Address book of mail system
    With MAPISession
    '.Compose
    .Compose
    .RecipDisplayName = pName
    .AddressResolveUI = True
    On Error GoTo NameErr1
    .ResolveName

    If .RecipDisplayName <> pName Then
    GetAddressBook = ExtractName(.RecipDisplayName)
    End If
    End With

    ExitGet:
    Exit Function

    NameErr1:
    Select Case Err()
    Case Is = 32001
    response = MsgBox("Must select a valid name from the address book.", vbCritical + vbRetryCancel, "User Name Error")
    If response = vbRetry Then
    Resume
    Else
    GetAddressBook = " "
    Resume ExitGet
    End If
    End Select
    End Function

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