If Outlook is open I get an exeption in both GetActiveOleObject (Operation not available) and CreateOleObject (executeing server failed), ok if Outlook is closed. On the other hand if I stop my application after CreateOleObject and try to open Outlook I get the message "a problem occured executing Outlook. You may execute only one version at a time" (messages translated from german).
try OutlookApp := GetActiveOleObject('Outlook.Application'); except on E: exception do begin OutlookApp := CreateOleObject('Outlook.Application'); end; end;
From novice to tech pro — start learning today.