Solved

MAPI question

Posted on 2000-04-04
5
175 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now