How do I resolve Runtime Error -2147219712 (80040600):` The operation failed

user3138025

The following code snippet works in Windows 10 / Outlook 2013.

In Windows 10 / Outlook 2016 I get an error at the .send line:

Run-time error -2147219712 (80040600):` The operation failed.

The messaging interfaces have returned an unknown error. If the problem persists, restart Outlook. Cannot resolve recipient.

Option Explicit
Sub email_test()
Dim objOutlookApp               As Outlook.Application
Dim objOriginalItem             As Outlook.MailItem
Dim objNewItem                  As Outlook.MailItem
Dim objInspector                As Outlook.Inspector
Dim objRecipient                As Outlook.Recipient
Dim strEmailAddress             As String
Dim strSubject                  As String

Set objOutlookApp = GetObject(, "Outlook.Application")
Set objInspector = objOutlookApp.ActiveInspector
'Set objOriginalItem so that it can be referenced
Set objOriginalItem = objInspector.CurrentItem
'Set objNewItem to create the new message.
Set objNewItem = objOutlookApp.CreateItem(0)
'Store the original body into the new item body
'Note:  objNewItemBody was altered by code not shown here
objNewItem.Body = objOriginalItem.Body
'Note: strEmailAddress was altered by code not shown here
strEmailAddress = "unique_ [email protected]"
Set objRecipient = objOutlookApp.Session.CreateRecipient(strEmailAddress)
objRecipient.Resolve
MsgBox ("The objrecipient.resolved status is: " & objRecipient.Resolved)
'Set the fields of the MailItem.  Note:  objNewItem.Body was previously set
With objNewItem
    .Display
    .Subject = objOriginalItem.Subject
    .To = objRecipient
        'Loop through the attachments in objOriginalItem
        'Save them to the user's temp folder.
        'Attach them to objNewItem.
    .Send
End With

EXUNT:
Set objOutlookApp = Nothing
Set objOriginalItem = Nothing
Set objNewItem = Nothing
Set objInspector = Nothing

End Sub

In Outlook 2016 the MsgBox indicates "True", The User Interface has a window open for the new mail object and the properly-formatted Email address is there.

When I click on the "To" field and then click "Send", the Email is sent.

Outlook 2013 yields a MsgBox indicating "False", but it sends the eMail with user intervention anyway.

How do I resolve this in Outlook 2016 to send the Email without user intervention?

Dmitry Streblechenko

0x80040600 is MAPI_E_CORRUPT_STORE. In case of a PST store, that most likely means the PST file is corrupted - try to run scanpst.exe. In case of a cached Exchange store, try to delete the OST file and restart Outlook - it will rebuild the OST file.

MAPI error codes can be looked up in OutlookSpy (click "Error Code Lookup" on the OutlookSpy ribbon).

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

How do I resolve this ProductFlavours error

How do I resolve this ambiguous type error in Swift?

How do I resolve the pod install error on flutter?

How do I resolve Jest Mock error "Cannot find module"

How do I fix 'Error: PasteSpecial method of Range class failed'?

Error:Failed to resolve: wearable

How to resolve error :Left side ($point) of '>=' operation has null value

How to fix error "Failed to resolve:..." on Android Studio 1.4

How can I resolve this error from symfony?

In MiniZinc how can I resolve this error?

How can I resolve this error from symfony?

How can I resolve an error in Targetpath?

How do I resolve persistentvolumeclaims "hub-db-dir" is forbidden error while deploying jupyter hub on kubernetes?

How do I resolve SVN error "E200030: There are unfinished transactions detected in '<CHECKOUT_DIRECTORY>'"?

How do I resolve "bash: ./SupportTool.exe: cannot execute binary file: Exec format error"?

How do I resolve this bean defninition override?

How do I resolve this diamond problem in Kotlin?

How do i resolve this? (Apex Oracle)

How do I resolve nested promises in an object

Error Failed to resolve dependencies grails

How do I create a UiWidget at runtime as an entity?

why do i get an runtime error with bar_index?

How do I resolve peer dependency error: The package [email protected] does not satisfy its siblings' peerDependencies requirements

Dynamic Array Runtime Error - code working but not for large input values | How to resolve?

How do I fix "clang: error: linker command failed with exit code 1 (use -v to see invocation)" error?

ERROR: Failed to resolve: vectordrawable-animated

How can I resolve a package installation error in Julia on Windows?

How to resolve 'no matching mac found error' when I try to ssh

how can i resolve this error while installing web3