Delphi XE7, Outlook 2013 with 2 profiles
I have the following code:
OutlookApp := CreateOleObject('Outlook.Application');
Mapi := OutlookApp.GetNameSpace('MAPI');
if MapiLogOn(0,PAnsiChar(AnsiString(Profile)),'',MAPI_NEW_SESSION,0,@hSession) = 0 then
I have 2 problems:
1. if outlook is already executed I get an error (by CreateOleObject) "starting the server failed"
2. if outlook is not started outlook starts and displays a message to choose the profile (by CreateOleObject('Outlook.A
') and all works fine, but I won't log on and use outlook invisible and automatic. How can I do that?