Solved

Getting MAPI Profile in VB

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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

11 Experts available now in Live!

Get 1:1 Help Now