Select Outlook account for sending mails (1 Viewer)

spikepl

Eledittingent Beliped
Local time
Today, 23:06
Joined
Nov 3, 2010
Messages
6,142
I need to select a specific IMAP-account in Outlook 2007 for each mail, when sending mails from Access 2007 via Outlook.

This code can select an account http://www.rondebruin.nl/mail/account.htm, but the mails are nevertheless sent from the default account. Scouring the web implies that non-POP3 accounts, like IMAP, can perhaps be tricky.

I have only occasional access to the client for testing, so would like to turn up with a bunch of options.

There seems to be very little info out there, and the .SendUsingAccount is poorly documented. For Outlook 2010 there is some suggested trickery, involving setting up phony POP3-accounts with the same data as the IMAPs, but I really really don't want to go there. Redemption might be a last-stop solution, perhaps.

Does anyone know how to select a specific Outlook 2007 IMAP account from Access 2007?
 

spikepl

Eledittingent Beliped
Local time
Today, 23:06
Joined
Nov 3, 2010
Messages
6,142
I have set up a test with two IMAP accounts.

No matter what I do I am unable to select the non-default account for sending. The code linked to in #1 works just fine, the proper account gets set in .SendUsing Account, but Outlook simply does not care and uses the default account.:confused:
 

spikepl

Eledittingent Beliped
Local time
Today, 23:06
Joined
Nov 3, 2010
Messages
6,142
After a few days of pain I got it to work, despite the Outlook documentation.

MailItem.SendUsingAccount is an object. So when you find the oAccount to send from, you need to do a

Code:
Set MyMailItem.SendUsingAccount=oAccount

and not just

Code:
MyMailItem.SendUsingAccount=oAccount
 

Users who are viewing this thread

Top Bottom