- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI have a Visual Basic application that, when executed, automatically sends an E-mail via MAPI.
The application needs to run invisibly, so I do not desire any popup windows.
The problem is that MAPI needs a profile name as follows:
MAPISession1.UserName = "doejohn"
This works great when you can predetermine that "doejohn" is the correct profile name to use.
In my case, the correct profile name to use will ALWAYS be the default Outlook profile, no matter what it is called.
So basically, can someone tell me how to detect the default Outlook profile?
I do NOT wish to use additional applications, etc. There must be a way to determine the default profile from within Visual Basic.
This application is used on various machines, so the default profile name will likely be different for each user.
The following is a sample code snippet of what I would like to accomplish, assuming I can determine the value of strDefaultOutlookProfileNa
MAPISession1.UserName = strDefaultOutlookProfileNa
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose
MAPIMessages1.RecipAddress
MAPIMessages1.MsgSubject = "This is the subject."
MAPIMessages1.MsgNoteText = "This is the content."
MAPIMessages1.ResolveName
MAPIMessages1.Send
MAPISession1.SignOff
Thanks, in advance, for any help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: ahmedbahgatPosted on 2003-06-23 at 18:26:06ID: 8786022
if you can read the windows registry within your code then you can read this value which is the default profile, the following from Win2k /NT4 /XP machines
icrosoft\W indows NT\CurrrentVersion\Windows Messaging Subsystem\Profiles\Default Profile
icrosoft\W indows Messaging Subsystem\Profiles\Default Profile
HK_Current_User\Software\M
or under 98\95 machines
HK_Current_User\Software\M
cheers