Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting MAPI Profile in VB

Posted on 2001-07-02
3
Medium Priority
?
349 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
[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
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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
Suggested Courses

704 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