New Outlook.application Error C#
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions marshal.getactiveobject( outlook.application ) you might have Meta Discuss the workings and policies of
Operation Unavailable (exception From Hresult: 0x800401e3 (mk_e_unavailable))
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring mk_e_unavailable outlook developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
C# Operation Unavailable Exception From Hresult 0x800401e3 Mk_e_unavailable
community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting/Creating an Outlook Application in Windows 7 up vote 14 down vote favorite 5 I'm trying to get the current running version of Outlook or start up Outlook in case it is not 80080005 server execution failed (exception from hresult: 0x80080005 (co_e_server_exec_failure)) running, but I am having some issues in getting or creating the Outlook Application object in Windows 7. I think it has something to do with the user priviliges that are restrictive in Vista and 7. I am working with Outlook 2010. edit: These errors only appear if I already have an Outlook 2010 instance started. If Outlook is not started, the application can run smoothly (it can start an Outlook instance by itself). If anybody can tell me how to correctly get the Outlook Application version, that would be really helpful. The code I'm running is a long try-catch block that keeps on triggering exceptions: try { // create an application instance of Outlook oApp = new Microsoft.Office.Interop.Outlook.Application(); } catch(System.Exception ex) { try { // get Outlook in another way oApp = Marshal.GetActiveObject("Outlook.Application") as Microsoft.Office.Interop.Outlook.Application; } catch (System.Exception ex2) { // try some other way to get the object oApp = Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application")) as Microsoft.Office.Interop.Outlook.Application; } }
has been opened by another user account Visual Studio Development , Microsoft Office for Developers > Visual Studio Tools for Office (VSTO) Question 0 Sign in to vote Hello I have an addin that customizes the excel ribbon. I added a
Marshal.getactiveobject( Outlook.application ) Error
button so that when the user clicks it, a new outlook message windows pops up with
Microsoft.office.interop.outlook.application Example C#
some default information on the email body, CCs, etc. The problem is that if outlook is already running and it's running under another user marshal getactiveobject outlook application mk_e_unavailable account different from the one that was used to open excel (e.g. after opening excel i open outlook with shift + right click and then "Run As..."); i get an exception upon instantiating the outlook interop object: Microsoft.Office.Interop.Outlook.Application app = http://stackoverflow.com/questions/3750605/getting-creating-an-outlook-application-in-windows-7 new Microsoft.Office.Interop.Outlook.Application(); The exception message reads: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). What can i do to prevent this issue from happening? Thanks Tuesday, July 19, 2011 8:30 PM Reply | Quote Answers 0 Sign in to vote Not using Outlook, no. Outlook can only run one session at a time and if it's running a session under a certain logon it https://social.msdn.microsoft.com/Forums/vstudio/en-US/870d6093-a7fb-4431-a38f-1896ce4cf963/failing-to-create-an-email-with-outlook-interop-when-outlook-has-been-opened-by-another-user-account?forum=vsto can't then be logged into from a different logon. An alternative is to use a different machine if you don't need to log into that same Outlook session. Other than that you might be able to use Redemption (www.dimastr.com/redemption) or Extended MAPI (C++ or Delphi/Pascal only, long learning curve). I've used Redemption to log into different malboxes as long as the permissions are there to allow it. For example, I can log into Mailbox A and if that logon has permissions on Mailbox B and C I can then log into B and C in succession as needed. That of course would only work with Exchange mailboxes. A non-Exchange profile locks the PST file exclusively so you couldn't do anything with a PST file profile. -- Ken Slovak MVP - Outlook http://www.slovaktech.com Author: Professional Programming Outlook 2007 "wildarmss" <=?utf-8?B?d2lsZGFybXNz?=> wrote in message news:ec6c647d-c16f-4a3c-ab47-956a323e83b6... Hi Ken That is not a restriction i can impose the users, is there any other way? Ken Slovak MVP - Outlook Marked as answer by wildarmss Monday, July 25, 2011 2:37 PM Friday, July 22, 2011 3:12 PM Reply | Quote All replies 1 Sign in to vote In that situation I would test first for an existing Outlook process running and hook into it if it is running. If it's not running then I'd use new to create an Outlook session. There can only be one Outlook session
3, 20084 Share 0 0 Having problems in instantiating a new Outlook object from VS 2008(Windows Form Application) when running on https://blogs.msdn.microsoft.com/akashb/2008/11/03/unable-to-instantiate-outlook-object-from-visual-studio-2008-on-vista-with-uac-on/ Vista with UAC ON? Getting weird errors similar to the ones below? System.Runtime.InteropServices.COMException was unhandled Message="Creating an instance of the COM component with CLSID {0006F03A-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001." Source="MyApp" ErrorCode=-2147418111 This error was when Outlook was NOT running and I tried exception from to debug my application from Visual studio 2008. System.Runtime.InteropServices.COMException was unhandled Message="Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005." Source="MyApp" ErrorCode=-2146959355 This error was when Outlook was already running and I tried to debug my application from Visual studio 2008. exception from hresult In both cases I got the error when I tried to instantiate a new object of the Outlook.Application. oApp = new Outlook.Application Using the Err.exe to get more details on the 80010001 and the 80080005 we get the following details: # for hex 0x80010001 / decimal -2147418111 : DBG_EXCEPTION_NOT_HANDLED ntstatus.h # Debugger did not handle the exception. RPC_E_CALL_REJECTED winerror.h # Call was rejected by callee. # 2 matches found for "80010001" # for hex 0x80080005 / decimal -2146959355 : CO_E_SERVER_EXEC_FAILURE winerror.h # Server execution failed # 1 matches found for "80080005" Why would we be getting a RPC_E_CALL_REJECTED or CO_E_SERVER_EXEC_FAILURE? In my case this was happening because of the difference in Integrity Level of the two processes(Outlook.exe and devenv.exe) The Visual Studio 2008 was being "Run as administrator" which makes it run in High IL and Outlook was by default running in Medium IL and this was causing