troubleshooting Question

Interop Outlook - Create MSG in Windows Service

Avatar of tbaseflug
tbaseflugFlag for United States of America asked on
Outlook.NET ProgrammingC#
1 Comment1 Solution1073 ViewsLast Modified:
What I am trying to do - is create an Outlook MSG file via a windows service - I have the below, but on the SaveAs - I keep getting an error:

ystem.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
   at Outlook._MailItem.SaveAs(String Path, Object Type)

Here is my code:

Outlook.Application objOutlook = CreateInstance();
Outlook.MailItem mic = (Outlook.MailItem)(objOutlook.CreateItem(Outlook.OlItemType.olMailItem));
                                        mic.HTMLBody = "";

mic.SaveAs(@"\\DATA23\pdecat\test.msg", Outlook.OlSaveAsType.olMSG);

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros