We help IT Professionals succeed at work.

Interop Outlook - Create MSG in Windows Service

tbaseflug
tbaseflug asked
on
1,062 Views
Last Modified: 2012-02-15
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);
Comment
Watch Question

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.