Setting up a new outlook account programmatically

E

Ewgenij Sokolovski

Hello, folks. I want to set up a new outlook account programmatically.
How can I do that? I looked at the MSDN Outlook library and found the
account object there http://msdn.microsoft.com/en-us/library/bb208228.aspx

But I see only readonly properties there. And even if they were not
readonly, I do not see the pop3-address, the password there....

BR
Ewgenij
 
K

Ken Slovak - [MVP - Outlook]

That's not exposed at all in the Outlook object model. If you want to use
code and not something like PRF files to configure an account you have to
use Extended MAPI code with C++ or Delphi or you can use the ProfMan utility
that comes with Redemption (www.dimastr.com/redemption) to do what you want.
 
D

Dmitry Streblechenko

But keep in mind that POP3/SMTP/IMAP etc accounts are no longer MAPI based
and can only be accessed using the IOlkAccountMgr object, but MS has not
documented the parts responsible for creating new accounts: you can omnly
modify/delete existing accounts.
If you are not using C++ or Delphi (required to use IOlkAccountMgr),
Redemption wraps that interface through the RDOSession.Accounts collection -
http://www.dimastr.com/redemption/rdo/RDOAccounts.htm

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

Ewgenij Sokolovski

If you want to use
code and not something like PRF files to configure an account

Hello! Actually, it does not matter for me, how the accounts are
created. What I want is a user clicking on a button of my toll and the
account(s) being created in Outlook on that click. How the whole stuff
is implemented: whether with code or with prf-files or whatsoever, is
completely irrelevant! So, you think I can manage that with PRF-files?

BR
Ewgenij
 
E

Ewgenij Sokolovski

If you want to use
code and not something like PRF files to configure an account

Hmm, now I created a PRF file with required mail accounts. I wanted to
import it into outlook as described here:

Specify the PRF file as a command-line option for Outlook.exe to
import a PRF file without prompting the user. Example: outlook.exe /
importprf \\server1\share\outlook.prf.
http://technet.microsoft.com/en-us/library/cc179062.aspx

However, Outlook does not seem to be aware of the existence of the new
profile. I do not see it in the profile selection box. An additional
backup profile is added, though. I am quite perplex now. What is
wrong? I went another way and created a corresponding MSP file. That
worked and I could insert the accounts into Outlook. But I need
something like the PRF file, I can edit in my tool!

BR
Ewgenij
 
K

Ken Slovak - [MVP - Outlook]

I don't know what's wrong with your PRF file or how to make it work
correctly. That's more of an administrator question than a developer
question and you might have better luck with it in a standard Outlook group
where there's more expertise in that sort of thing.
 
K

Ken Slovak - [MVP - Outlook]

Something like microsoft.public.outlook or microsoft.public.outlook.general.
 
R

Ragout Olivier

Hello,

I've a problem with Redemption RDO library, i wrote the code below where
i want to change SMTP server properties but nowhere i found the method
to change/store the password. My SMTP server need authentification i can
change the SMTP_UseAuth property, change the SMTP_UserName but how to
change the password associated to the UserName ? Nowhere i found the
right method. Here's my code :

"

Set TSession = CreateObject("Redemption.RDOSession")

TSession.MAPIOBJECT = Application.Session.MAPIOBJECT

Set Accounts = TSession.Accounts

For Each Account In Accounts

If Account.AccountType = 0 Then 'atPOP3

If Account.Name = "(e-mail address removed)" Then
Account.SMTP_UseAuth = True
Account.SMTP_LogonKind = 1
Account.SMTP_UserName = "(e-mail address removed)"
Account.SMTP_Server = "smtp.qwerty.com"
Account.Save
'But i d'ont find the property to set the password on
http://www.dimastr.com/redemption/

End If

end if
next

"

If you've any idea to help me.

Best Regards.

Olivier


*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top