I've got some code for composing an e-mail from the contents of an RTF box. The first time I execute it, everything works fine. If I close my app and then re-run it, however, I always receive the following error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154.
When reaching the line:
Outlook.Applica tion outlookApp = new Microsoft.Offic e.Interop.Outlo ok.Application( );
The only way I can solve this is to go into Add/Remove Programs and uninstall/reinstall the interop assemblies for Outlook. I have no idea what's causing this, because Microsoft's programmers apparently didn't see fit to include actual error descriptions that help you fix them.
Can anyone help me with this issue?
Code:
Outlook.Applica tion outlookApp = new Microsoft.Offic e.Interop.Outlo ok.Application( );
Outlook.MailIte m email = (Outlook.MailIt em)outlookApp.C reateItem(Micro soft.Office.Int erop.Outlook.Ol ItemType.olMail Item);
email.Body = rtfReader.Rtf;
email.BodyForma t = Microsoft.Offic e.Interop.Outlo ok.OlBodyFormat .olFormatRichTe xt;
email.Display(f alse);
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154.
When reaching the line:
Outlook.Applica tion outlookApp = new Microsoft.Offic e.Interop.Outlo ok.Application( );
The only way I can solve this is to go into Add/Remove Programs and uninstall/reinstall the interop assemblies for Outlook. I have no idea what's causing this, because Microsoft's programmers apparently didn't see fit to include actual error descriptions that help you fix them.
Can anyone help me with this issue?
Code:
Outlook.Applica tion outlookApp = new Microsoft.Offic e.Interop.Outlo ok.Application( );
Outlook.MailIte m email = (Outlook.MailIt em)outlookApp.C reateItem(Micro soft.Office.Int erop.Outlook.Ol ItemType.olMail Item);
email.Body = rtfReader.Rtf;
email.BodyForma t = Microsoft.Offic e.Interop.Outlo ok.OlBodyFormat .olFormatRichTe xt;
email.Display(f alse);
Comment