none
Getting 0x80004002 error attempting to create a mailitem RRS feed

  • Question

  • Hi,

    Am attempting to create a new mail item from a VB Forms app (VS 2010), I have Office 2010 installed and the correct reference to version 14.0.0.0 of the Interop assemblies:

                           Dim app As New Microsoft.Office.Interop.Outlook.Application
    errors on >     Dim mail As MailItem = CType(app.CreateItem(OlItemType.olMailItem), MailItem)

    Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

    This is happening from VS 2010, OS is Windows 7 64 bit with Office 2010 (never had any other version of Office installed).   Outlook is connecting to Exchange Server 2007.

    I've trolled through the other posts relating to this error but they seem to be with different situations.

    Any help much appreciated, thanks in advance.

    Friday, November 9, 2012 5:54 AM

Answers

  • Sure looks like so\me of the Office type library registry keys were deleted or corrupted.

    Can you try to reinstall/repair Office on that machine?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    • Marked as answer by StevieRayCoder Friday, November 9, 2012 11:54 PM
    Friday, November 9, 2012 6:38 PM

All replies

  • what office bitness? how is your app compiled? as anycpu or specific bitness?

    if you call outlook creation of form load event but mail creation on some button click event (and wait with clicking that button few seconds) does it also happen?

    Friday, November 9, 2012 8:28 AM
  • Thanks for responding.

    Office 2010 is 32 bit.  I tried all 3 options for compile, tried outlook creation in form load as well with no luck.

    Friday, November 9, 2012 5:31 PM
  • I just tried some other code that had been previously working - it grabs a list of contacts from an Outlook contacts folder - it is giving an "Interface not registered" error 0x80040155 which looks to be the same or similar issue as the mailitems error above.

    This was working before when we were using PST files, we are now using exchange server 2007.  Is there some different coding required is Outlook is connected to Exchange?

    Thanks

    Friday, November 9, 2012 6:28 PM
  • Sure looks like so\me of the Office type library registry keys were deleted or corrupted.

    Can you try to reinstall/repair Office on that machine?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    • Marked as answer by StevieRayCoder Friday, November 9, 2012 11:54 PM
    Friday, November 9, 2012 6:38 PM
  • Repairing Office did the trick!  Many thanks!
    Friday, November 9, 2012 11:55 PM