Solved

MAPI question

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending a email via excel using vba 6 117
Add a task in Outlook from access 11 43
How to Add / Edit Windows Menu 4 80
Prevent user closing word document opened with VB6 6 88
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

739 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