Link to home
Start Free TrialLog in
Avatar of tbaseflug
tbaseflugFlag for United States of America

asked on

Interop Outlook - Create MSG in Windows Service

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);
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial