Solved

MAPI question

Posted on 2000-04-04
5
180 Views
Last Modified: 2010-05-02
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
Comment
Question by:cantrell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Expert Comment

by:TT
ID: 2686104
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
 
LVL 2

Author Comment

by:cantrell
ID: 2719099
I get an error message "Object Variable or With Variable Not set" when I use this code... Any ideas?
0
 
LVL 1

Expert Comment

by:chualk
ID: 2721339
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
 

Accepted Solution

by:
TT earned 25 total points
ID: 2721662
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
 
LVL 2

Author Comment

by:cantrell
ID: 2721705
I got it working. Thank you for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question