473,769 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#, Office.Interop. Outlook.Applica tion error 80040154

15 New Member
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);
Nov 1 '07 #1
2 10733
RodneyAnonymous
15 New Member
Update: At this point, I have tried several methods found across various regions of the intertron, including:

-Marshal.Release ComObject(outlo okApp), outlookApp = null, and outlookApp.Quit in the Form_Closed/Form_Closing events and at the end of the function
-email.Send(), rather than email.Display()

So far none of these have worked.
Nov 1 '07 #2
RodneyAnonymous
15 New Member
Does anyone have any idea about this?
Nov 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2616
by: Patrick Jox | last post by:
Hello, I created a .NET COM Add-In which exposes a new Menu with two MenuItems. The one to create a calendaritem and the other one to display the first contact in the default contactsfolder. What I want to do now is to register an eventhandler that listens to the close event of the contact. There is a ItemEvents_CloseEventHandler but I have no event exposed by the contactitem to connect the listener. Does anybody know how I can register...
1
6932
by: Stephen Noronha | last post by:
Hi, I am trying a sample app to send an email from my app I am getting a "type not defined error" I have added "Office and Outlook" COM component but still I am getting this error... Please advice, Stephen
2
2612
by: Miguel Arenas | last post by:
I want to develop a aplication with VB.2003 and Microsoft outlook 2003. I have this code. Imports OutLook = Microsoft.Office.Interop.Outlook Imports System.Reflection Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
0
1530
by: Tim | last post by:
I have a .net application using the outlook interface to create and maintain outlook calendar items. It's a free standing application, not integrated into outlook. When Outlook is configured for cached Exchange mode, the changes to the calendar items are not synchronized with the Exchange server unless Outlook is started. How can I programatically from my application force a folder synchronization to bring all folders up to date? ...
7
2798
by: Markus Donath | last post by:
I want to create an Outlook-appointment using .NET VC. My Visual Basic example starts with: Dim oApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application But my C++ translation: Microsoft::Office::Interop::Outlook::Application *oApp = new Microsoft::Office::Interop::Outlook::Application;
0
1312
by: rdufour | last post by:
In My form declaration I have, I also have a reference set to Microsot office 11 interop outlook Imports Microsoft.Office.Interop.Outlook In my sub I hav code Dim oApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application This gives me an unhandled exception Retrieving the COM class factory for
2
7303
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
1
2871
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
3
11652
OuTCasT
by: OuTCasT | last post by:
Hi I have created an asp.net project that exports items from datagridview to and outlook calendar This is the code that i have used.. Dim body As String Dim ends As String Dim location As String Dim start As String Dim subject As String
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.