Skip navigation

Logging On to a Users Default Profile With CDO

When logging on to a CDO Session object and the user has another mail program running (like Outlook), if you don't know the name of the current user's mail profile, and you try to log in with this line

objMAPISession.Logon

the user is prompted for a profile name (even if they're already logged in and/or have a profile set as the default).

To prevent the prompt, you just specify False values for the Logon method's ShowDialog and NewSession parameters, like this:

objMAPISession.Logon , , False, False

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish