如何打开 Outlook 窗口?我尝试了下面的代码,但是当 Outlook 的实例已经运行时这不起作用 -
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("OUTLOOK");
int processCount = processes.Length;
if (processCount != 0)
{
**outlookApp = Marshal.GetActiveObject("Outlook.Application") as Microsoft.Office.Interop.Outlook.Application;** this is throwing the below error **
}
else
{
outlookApp = new Microsoft.Office.Interop.Outlook.Application();
}
我得到了:
Error:
Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))
有人可以对上述代码提供替代方法或更改吗?