Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

MAPI question

I am showing the 'address book' using the mapisession control, and that works fine - I just need to know how to get the email address of the person they select. How do I do that?
0
cantrell
Asked:
cantrell
  • 2
  • 2
1 Solution
 
TTCommented:
Private Sub GetAddress()

Dim lsTo as String
Dim lsCc as String
Dim MAPIMess as MAPIMessages
   :
   :
' Show MAPI Address book & did selection  
   :
   :
lsTo = GetRCList(MAPIMess,  
vbRecipTypeTo)

lsCc = GetRCList(MAPIMess,  
vbRecipTypeCc)

End Sub
Function GetRCList(ByRef Msg As Control, _
ByVal RCType As Integer _
) As String

Dim liloopi_cnt As Integer
Dim lsTmp_str As String
       
For liloopi_cnt = 0 ToMsg.RecipCount - 1
    Msg.RecipIndex = liloopi_cnt
    If RCType = Msg.RecipType Then
       lsTmp_str = lsTmp_str + ";" +
       Msg.RecipDisplayName
    End If
Next liloopi_cnt

If lsTmp_str <> "" Then
   lsTmp_str = Mid(lsTmp_str, 2)  
   'Strip off the leading ";".
End If

GetRCList = lsTmp_str

End Function
0
 
cantrellAuthor Commented:
I get an error message "Object Variable or With Variable Not set" when I use this code... Any ideas?
0
 
chualkCommented:
Hi, I am expected u are already login to
MAPI Sessions and manage to get into
addresses selection screen, did u ?

if yes, of course u shd replace the
MAPIMessages that I had named MAPIMESS
to what u name it.
0
 
TTCommented:
The comment entered by chualk actually
come from TT, cause I used chualk's PC
and forgot to changed the default login :

Hi, I am expected u are already login to
MAPI Sessions and manage to get into
addresses selection screen, did u ?

if yes, of course u shd replace the
MAPIMessages that I had named MAPIMESS
to what u name it.

0
 
cantrellAuthor Commented:
I got it working. Thank you for your help.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now