Solved

Getting MAPI Profile in VB

Posted on 2001-07-02
3
335 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
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…
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…

789 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