Solved

Getting MAPI Profile in VB

Posted on 2001-07-02
3
331 Views
Last Modified: 2012-06-21
Hi,

I'm new to MAPI and I need help for the following :-

1. How do you detect that MAPI is installed in Windows?

2. Does anyone know how to obtain the list of all MAPI profiles from within Visual Basic?

Please provide sample code so that I can understand it more.

Thank you.
0
Comment
Question by:dinoang22
3 Comments
 
LVL 5

Expert Comment

by:ianouii
ID: 6244394
usually, your windows will have the MAPI object once u have your microsoft office 2000 installed. else, u can always copy the MAPI.dll into it. put it at system32.

all the MAPI profiles can be obtained from MSDN. look for MAPI. if u want to obtain the very brief explanation within VB, just add a MAPI component onto your form.

double click on the MAPI icon, u should be able to see the mapsess and mapmess. they are two different things. highlight the word & press F2. u should be able to see all it's functions.

good luck.
0
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 50 total points
ID: 6244810
You need to read the mail section in the win.ini file.  When mapi is installed, the entries will look something like:

[Mail]
MAPI=1
CMC=1
CMCDLLNAME32=mapi32.dll
CMCDLLNAME=mapi.dll
MAPIX=1
MAPIXVER=1.0.0.1
OLEMessaging=1

In order to read this section, you would use the GetProfileString API call.  This call is well documented at the Microsoft website and many, many VB websites on the net.


For part #2:
Since VB is not sophisticated enough to use Extended MAPI and the interfaces used to return a list of profiles, you would have to resort to reading the registry.  This section for tracking MAPI profiles varies between Win9x and NT/2000, but the general location of each is:

  * Win9x users
  HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles\
  * WinNT users
  HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\

vbaccelerator.com has a great registry class for vb that will let you reitterate all keys of a given section.
0
 

Author Comment

by:dinoang22
ID: 6247272
Hi Neompvs,

Thanks for the information. It really works.

Cheers dude.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 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

21 Experts available now in Live!

Get 1:1 Help Now