enigmasolutions
asked on
Using CreateOleObject('Outlook.Application') causes “Server execution failed” error
Hi,
We have written an application in Delphi XE3 that sends emails via Outlook OLE. FYI - see source code.
It has been working perfectly well for years until I upgraded to Windows 10.
Now I get "Server execution failed" whenever my Outlook 2013 is running.
Of course it works when Outlook is not running.
It also works when I run both my EXE as well as Outlook as Administrator. BUT, when I do this outlook complains when I try to create emails (Outlook doens't like being run as Administrator).
Here is a link which explains a lot about what is happening. http://stackoverflow.com/questions/29338902/using-createoleobjectoutlook-application-causes-server-execution-failed-er
I just want to run my EXE as "normal" and Outlook as "normal" - ie not as administrator.
But it is not working. Why?
How can I make sure both processes run in the same security context?
xxx.txt
We have written an application in Delphi XE3 that sends emails via Outlook OLE. FYI - see source code.
It has been working perfectly well for years until I upgraded to Windows 10.
Now I get "Server execution failed" whenever my Outlook 2013 is running.
Of course it works when Outlook is not running.
It also works when I run both my EXE as well as Outlook as Administrator. BUT, when I do this outlook complains when I try to create emails (Outlook doens't like being run as Administrator).
Here is a link which explains a lot about what is happening. http://stackoverflow.com/questions/29338902/using-createoleobjectoutlook-application-causes-server-execution-failed-er
I just want to run my EXE as "normal" and Outlook as "normal" - ie not as administrator.
But it is not working. Why?
How can I make sure both processes run in the same security context?
xxx.txt
ASKER
Hi xtermie, I couldn't see anything that would help.
How can I determine or set the security context that my program and outlook run in?
How can I determine or set the security context that my program and outlook run in?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Sinisa, Your comment looks very good. My first test to do similar to your idea still did not work. But I will further investigate the other ideas / links. Thank you.
This still did not work - the GetActiveOleObject failed.
try
OutlookApp := GetActiveOleObject('Outloo k.Applicat ion');
except
OutlookApp := CreateOleObject('Outlook.A pplication ');
end;
This still did not work - the GetActiveOleObject failed.
try
OutlookApp := GetActiveOleObject('Outloo
except
OutlookApp := CreateOleObject('Outlook.A
end;
Solution provided by experts along with valid suggestions
https://support.microsoft.com/en-us/kb/257757