fairy birds
asked on
issue in using outlook in c# windows form
i make a desktop application..and i faced problem in receiving an email on a form.i face this error when load the email:
error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-0 0000000004 6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
please help............it's urgent
error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-0
please help............it's urgent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i can send email successfully ,but i cant load email....i have installed outlook,,,,,,and outlook is 64bit, pc was also 64bit and the project was x86.......... ialso try to set project configuration "any cpu" but stil i can receive this error
error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-0 0000000004 6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
error:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-0
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i also tried with x64........but its not working...........so now what can i do?
Does that mean that you are getting the identical error or some other error? If the same error I do not know what to have you do next seeming that the Outlook does not seem to be loaded. That could mean all three variables are not the same PC, Outlook and application, for example all x64 or all x86. Please check again.
ASKER
ASKER
sir i upload all info with pic that pc , offic and project congfi was 64 and also the error...........please sir help how we recover this
Can you post the equivalent of 2.PNG but from the microsoft outlook you have installed on the PC giving the problem.
ASKER
test
Thanks.
Have a look at
https://support.microsoft.com/en-us/help/870655/you-may-receive-an-error-code-80080005----server-execution-failed.-err
and follow the advice there.
Have a look at
https://support.microsoft.com/en-us/help/870655/you-may-receive-an-error-code-80080005----server-execution-failed.-err
and follow the advice there.
Ignore the 'test' comment - the submit comment button hadn't been working despite numerous refreshes and restarts of my browser.
ASKER
sir the provided instruction is for code 80080005 but my code error is "error: 80040154", is it same?
sir i follow the steps and after that we restat pc and run project....but its not working, again i get this error
so now, whats the next step sir
err.png
sir i follow the steps and after that we restat pc and run project....but its not working, again i get this error
so now, whats the next step sir
err.png
ASKER
is this error because of the activation of ms office?
The error is typically that the correct (32 or 64 bit) version of outlook is not installed. The solution is to install the required version of outlook - which you have done.
>>is this error because of the activation of ms office?
Have you had a problem with that? (You seem to be able to start and run outlook so that shouldn't be an issue).
>>is this error because of the activation of ms office?
Have you had a problem with that? (You seem to be able to start and run outlook so that shouldn't be an issue).
ASKER
hello............. the error is solved now..but i can't get the data from the outlook.........means the process has been completed sucessfully but does not show me the data...........
code is:
try
{
Outlook._Application app = new Outlook.Application();
//Outlook.NameSpace ns = new Outlook.NameSpace();
Outlook.NameSpace ns = app.GetNamespace("MAPI");
Outlook.MAPIFolder inbox = ns.GetDefaultFolder(Outloo k.OlDefaul tFolders.o lFolderInb ox);
ns.SendAndReceive(true);
dt = new DataTable("Inbox");
dt.Columns.Add("Subject", typeof(String));
dt.Columns.Add("Sender", typeof(String));
dt.Columns.Add("Body", typeof(String));
dt.Columns.Add("Date", typeof(String));
dataGridView1.DataSource = dt;
foreach (Outlook.MailItem item in inbox.Items)
{
dt.Rows.Add(new Object[] { item.Subject, item.Sender, item.HTMLBody, item.SentOn.ToLongDateStri ng() + "" + item.SentOn.ToLongTimeStri ng() });
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message , "message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
code is:
try
{
Outlook._Application app = new Outlook.Application();
//Outlook.NameSpace ns = new Outlook.NameSpace();
Outlook.NameSpace ns = app.GetNamespace("MAPI");
Outlook.MAPIFolder inbox = ns.GetDefaultFolder(Outloo
ns.SendAndReceive(true);
dt = new DataTable("Inbox");
dt.Columns.Add("Subject", typeof(String));
dt.Columns.Add("Sender", typeof(String));
dt.Columns.Add("Body", typeof(String));
dt.Columns.Add("Date", typeof(String));
dataGridView1.DataSource = dt;
foreach (Outlook.MailItem item in inbox.Items)
{
dt.Rows.Add(new Object[] { item.Subject, item.Sender, item.HTMLBody, item.SentOn.ToLongDateStri
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message
}
Not clear what solved it but the author does state it was solved. IMHO the most likely causes have been selected as the answer comments.
ASKER