Office (Outlook) Interop Issue on Windows Server 2008 R2

0

I made a small Console Application that sends a SMS. As you maybe know, you can send SMS with Outlook.

Well I finished and everything worked fine, but only on my Desktop PC with Windows 7.

On the machine where I really need it and where it should be installed it doesn't work!

It's a Windows Server 2008 R2 machine.

I found a Microsoft article about, that Office Automation is not "recommended" with Servers and that it "won't work well".

In my case it's a requirement and I must get it work somehow.

Here the Code to send SMS:

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
var sms = app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMobileItemSMS);
//Unnecessary Things between I removed
sms.Send(true);

The error I get is the following:

Operation aborted {Exception from HRESULT: 0x80004004 (E_ABORT)}

For any working solution or help I'm deeply grateful!

c#
automation
interop
ms-office
windows-server-2008-r2
asked on Stack Overflow Apr 5, 2013 by eMi • edited Apr 5, 2013 by Alexis Pigeon

1 Answer

0

I fixed the problem.

Little bit strange but changing Platform target in the Build Tab from "ANY CPU" to "x86" made the application successfully work/run on the windows server.

Maybe this can help others too :)

answered on Stack Overflow Apr 5, 2013 by eMi

User contributions licensed under CC BY-SA 3.0