Automation and Multiple profiles

N

Nicolas Mainczyk

Hi,

I have several profiles on Outlook and I need to automate the sent of a
mail.

Everything is fine except that when I use the
<< Mynamespace.Logon profile_name, password, False, True >> instruction, it
always run the default profile I set up. It actually behaves as if there is
an open session of Outlook with the default profile.

I tried to use every combination of true and false for the last 2
parameters.

Outlook is not run when I launch the process so no session is already
opened. I checked TSRs but none indicates Outlook or MAPISRV32 or stuff like
that.

I have a second little problem when I use the SentOnBehalfOfName method.
when the mail is received, the 'From ' field well indicated the
email_address1 but when I open it 'From' indicated the address of the
profile used. When I click Reply, my address appears. I used then the
'ReplyRecipientNames' method to force the 'reply to' to the correct address
but I would like my name not to appear or at least My name on behalf of
email_address1 which is however, well indicated in the 'sent items' folder
I tried to modify the 'SenderName' value but it says read only property.

Here is a sample code:
Dim ol As Object, myItem As Object
Set ol = CreateObject("outlook.application")
Set mynamespace = ol.GetNamespace("MAPI")
mynamespace.Logon profil, mdp, False, True
....
myItem.SentOnBehalfOfName = email_address1
myItem.ReplyRecipientNames = email_address1


Did anybody run across any of that problems ?

TIA,
Nicky.
 

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