Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2005

Tip: Looking for answers? Try searching our database.

Determining Current User's Default E-Mail Account

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Kallelis - 15 Jun 2005 20:02 GMT
Is there a way, using VBA in Outlook, to programatically determine what the
currently logged-in profile's default e-mail account is?  My company has a
product with customized Outlook functionality, but when the user's Outlook
profile has a different default e-mail account than Exchange (for instance, a
POP account), then we can encounter issues, so we're hoping to detect such a
problem in the setup process.  Is it possible to do this using MAPI, or do I
have to check the Windows registry itself?  Either way, what is the easiest
way to do this?

Thanks in advance for any help you can provide.
Sue Mosher [MVP-Outlook] - 15 Jun 2005 20:36 GMT
Outlook version?

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Is there a way, using VBA in Outlook, to programatically determine what the
> currently logged-in profile's default e-mail account is?  My company has a
[quoted text clipped - 6 lines]
>
> Thanks in advance for any help you can provide.
Jason Kallelis - 15 Jun 2005 21:11 GMT
2003, XP, and potentially 2000.

> Outlook version?
>
[quoted text clipped - 8 lines]
> >
> > Thanks in advance for any help you can provide.
Sue Mosher [MVP-Outlook] - 15 Jun 2005 22:45 GMT
There is no one-size-fits-all method. If WordMail is not the editor, then in Outlook 2002/3, you can read the default account name from the Standard toolbar. (See http://www.outlookcode.com/codedetail.aspx?id=889.)  The name of the default account is probably also buried in the Windows registry, under the mail profile settings (and in a totally different place for Outlook 2000 in IMO mode), but it would take a little lab work with Regmon or a registry comparison tool to discover where.
Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> 2003, XP, and potentially 2000.
>
[quoted text clipped - 8 lines]
>> >
>> > Thanks in advance for any help you can provide.
Dmitry Streblechenko - 16 Jun 2005 18:39 GMT
See the newly documented IOlkAccountManager interface:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/olintapi/html/o
liaIOlkAccountManager_HV01155206.asp

You can also play with it in OutlookSpy (click Misc | IOlkAccountManager).

You won't be able to use IOlkAccountManager in VBA though...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Is there a way, using VBA in Outlook, to programatically determine what
> the
[quoted text clipped - 11 lines]
>
> Thanks in advance for any help you can provide.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.