• Sign in
 
  •  
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...

  • Blog Home
  • About
  • Email Blog Author
  • Share this
  • RSS for posts
  • Atom
  • RSS for comments
  • CDO (25)
  • Code Snippet (43)
  • Custom Providers (17)
  • Debugging (7)
  • DevMsgTeam (303)
  • Documentation (111)
  • DST (8)
  • EWS (7)
  • Exchange (110)
  • Gotchas (98)
  • Hotfix (28)
  • MAPI (241)
  • MAPI Download (55)
  • MFCMAPI (102)
  • MSDN (59)
  • Non Dev (11)
  • OOM (17)
  • Outlook (171)
  • Outlook 2007 Auxiliary Reference (45)
  • Outlook Integration API (12)
  • Protocol Docs (20)
  • PST/OST (23)
  • Referrals (8)
  • Vista (12)
  • WrapPST (18)
Links:
  • Download MFCMAPI
  • MFCMAPI on Facebook
  • Troubleshooting Outlook Crashes
  • Office Update Center
  • Developer Messaging Team Blog
This site is provided "AS IS" with no warranties, and confers no rights. Use of included code samples are subject to the terms specified in the Terms of Use.
Archives
  • May 2013 (5)
  • April 2013 (1)
  • March 2013 (2)
  • February 2013 (2)
  • January 2013 (2)
  • December 2012 (4)
  • November 2012 (2)
  • October 2012 (2)
  • September 2012 (1)
  • August 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (3)
  • March 2012 (3)
  • February 2012 (3)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (1)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (4)
  • June 2011 (3)
  • May 2011 (3)
  • April 2011 (3)
  • March 2011 (5)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (1)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (3)
  • August 2010 (5)
  • July 2010 (3)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (5)
  • October 2009 (4)
  • September 2009 (5)
  • August 2009 (5)
  • July 2009 (11)
  • June 2009 (6)
  • May 2009 (5)
  • April 2009 (3)
  • March 2009 (18)
  • February 2009 (10)
  • January 2009 (3)
  • December 2008 (2)
  • November 2008 (2)
  • October 2008 (5)
  • September 2008 (4)
  • August 2008 (10)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (2)
  • April 2008 (4)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (5)
  • December 2007 (3)
  • November 2007 (2)
  • October 2007 (3)
  • September 2007 (1)
  • August 2007 (4)
  • July 2007 (5)
  • June 2007 (3)
  • May 2007 (4)
  • April 2007 (1)
  • March 2007 (6)
  • February 2007 (3)
  • January 2007 (2)
  • December 2006 (4)
  • November 2006 (3)
  • October 2006 (1)
  • August 2006 (1)
  • June 2006 (5)
  • May 2006 (5)
  • December 2005 (1)
  • November 2005 (4)
  • October 2005 (2)
  • September 2005 (1)
  • April 2005 (3)
  • December 2004 (2)
  • September 2004 (2)
  • August 2004 (3)
  • July 2004 (3)

Managing The Outlook Account Management Dialogs

MSDN Blogs > SGriffin's MAPI Internals > Managing The Outlook Account Management Dialogs

Managing The Outlook Account Management Dialogs

Rate This
Stephen Griffin - MSFT
2 Jul 2008 9:38 AM
  • Comments 12

[This is now documented here: http://msdn.microsoft.com/en-us/library/ff976789.aspx]

We've decided to document another function in the Account Management API, DisplayAccountList. This function allows you to display the Account Settings dialog:

Account Settings

and Add New E-Mail Account property sheet:

Add New E-mail Account

DisplayAccountList hangs off of IOlkAccountManager interface, occupying the second slot in the v-table, like so:

interface IOlkAccountManager : IOlkErrorUnknown
{
public:
	//Init Initializes the account manager for use. 
	virtual STDMETHODIMP Init(IOlkAccountHelper* pAcctHelper, DWORD dwFlags);
	
	//DisplayAccountList Displays the account list wizard
	virtual STDMETHODIMP DisplayAccountList(
		HWND hwnd,
		DWORD dwFlags,
		LPCWSTR lpwszReserved, // Not used
		DWORD dwReserved, // Not used
		const CLSID * pclsidReserved1, // Not used
		const CLSID * pclsidReserved2); // Not used

I'm working on a little sample to demonstrate the Account Manager API that I hope to post soon. It'll have an updated header. In the meantime, here's my attempt at MSDN style documentation for the function:

IOlkAccountManager::DisplayAccountList

Initializes the account manager for use.

Quick Info

See IOlkAccountManager.

HRESULT IOlkAccountManager::DisplayAccountList ( 
	HWND hwnd,
	DWORD dwFlags,
	LPCWSTR lpwszReserved,
	DWORD dwReserved,
	const CLSID * pclsidReserved1,
	const CLSID * pclsidReserved2
);

Parameters

hwnd

[in] Handle to the window to which the displayed dialog box is modal. This parameter can be zero.

dwFlags

[in] Flags to modify behavior.
ACCTUI_NO_WARNING
Do not display the warning that changes will not take effect until Outlook is restarted. Only applies if running in process with Outlook.exe.
ACCTUI_SHOW_DATA_TAB
Show the Account Settings dialog with the Data tab selected. Only valid if ACCTUI_SHOW_ACCTWIZARD is not set.
ACCTUI_SHOW_ACCTWIZARD
Display the Add New E-Mail Account wizard.

lpwszReserved,

[in] Not used. Should be NULL.

dwReserved

[in] Not used. Must be NULL.

pclsidReserved1

[in] Not used. Must be NULL.

pclsidReserved2

[in] Not used. Must be NULL.

Return Values

S_OK

The call was successful.

E_OLK_NOT_INITIALIZED

The account manager has not been initialized for use.

MAPI_E_INVALID_PARAMETER

dwReserved, pclsidReserved1 or pclsidReserved2 were non-NULL.

E_ACCT_UI_BUSY

The account dialog class could not be created.

MAPI_E_USER_CANCEL

The Account Settings dialog box returned an error.

MAPI_E_CALL_FAILED

The Add New E-Mail property sheet returned an error.

Remarks

The client calls IOlkAccountManager::DisplayAccountList to display either the Account Settings dialog or the Add New E-mail property sheet. The parameters dwReserved, pclsidReserved1 and pclsidReserved2 are not used at this time and MUST be NULL. The parameter lpwszReserved is not used and SHOULD be NULL.

Constants

#define E_ACCT_UI_BUSY 0x800C8102
#define ACCTUI_NO_WARNING      0x0100
#define ACCTUI_SHOW_DATA_TAB   0x0200
#define ACCTUI_SHOW_ACCTWIZARD 0x0400

BTW - Hey look! Pictures! Woo hoo!

7/3/08 - Update: Added ACCTUI_SHOW_DATA_TAB flag.
  • 12 Comments
MAPI, Code Snippet, Outlook Integration API, Documentation, Outlook 2007 Auxiliary Reference, DevMsgTeam, MSDN
Comments
  • Dmitry Streblechenko
    2 Jul 2008 1:42 PM

    Steve,

    Wouldn't it be nice if there were a method to add an account without displaying any UI? Am I pushing it? :-)

    Looking at the values of the documented flags (dwFlags), I have a feeling there are at least a dozen other flags.

    Do you really want people to try to figure them out and then blame MS when things start failing? :-)

  • Stephen Griffin - MSFT
    2 Jul 2008 1:57 PM

    There are around 8 other flags in the headers. Not a single one of them, as best as I could tell, is used. The two I documented are the only ones I see our code looking for. Same with the unused parameters. Three of them are explicitely checked to ensure they're null, and the fourth is completely ignored. For now anyway. :)

  • Dmitry Streblechenko
    2 Jul 2008 4:56 PM

    <sigh> I was hoping that the lpwszReserved parameter would let me pass an account stamp and see a particular account properties dialog...

  • Stephen Griffin - MSFT
    2 Jul 2008 5:09 PM

    I think it may have been so you could pass a title for the dialog - but it was never used.

  • Dmitry Streblechenko
    2 Jul 2008 6:23 PM

    But I bet there is something to display the Accounts dialog with a particular tab selected.

    This is used in a few places in Outlook, is it not?

  • Stephen Griffin - MSFT
    3 Jul 2008 10:42 AM

    You're right - there's a flag to set the Data tab. I made a mistake in my test code and thought it wasn't honored, so I didn't include it. I've added it in. I also went through the whole code path - I don't think there's any other flags you can pass. The flags documented are the only ones Outlook ever uses.

    When Outlook displays account setting dialogs with a different tab selected, it's not using this function.

  • Dmitry Streblechenko
    3 Jul 2008 1:50 PM

    I was hoping I could pass a GUID (e.g. CSLID_OlkStore) in the pclsidReserved1 parameter, but I'll take whatever I can :-)

    Thanks Steve!

  • Stephen Griffin - MSFT
    3 Jul 2008 1:55 PM

    Any non-null value there will get you MAPI_E_INVALID_PARAMETER. I know you're capable of loading this in the debugger and confirming. :)

  • Dmitry Streblechenko
    3 Jul 2008 2:12 PM

    That's what I did and all values gave me that error :-)

    Just a sidenote: these flags apply only to Outlook 2007.

    2002/2003 always display the same dialog no matter what the flags are.

  • Stephen Griffin - MSFT
    3 Jul 2008 2:26 PM

    No flags work in 2002. ACCTUI_NO_WARNING works in 2003. The documentation (and support) only targets 2007.

  • Lev
    15 Jul 2008 9:49 PM

    Are we any closer to docs on how to set passwords for SMTP/POP servers programmatically ( for an Internet-mail account )?  ( This is related to Dmitry's question about configuring an account without UI ).

    Thanks!

  • Stephen Griffin - MSFT
    15 Jul 2008 11:05 PM

    Don't think so - I've not been looking at that.

Page 1 of 1 (12 items)
Leave a Comment
  • Please add 7 and 4 and type the answer here:
  • Post
  • © 2013 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy & Cookies
  • Report Abuse
  • 5.6.426.415