Runtime error -1594867707

L

.Len B

I have the following code (stolen from MS KB161088) which fails
with error code -1594867707 (a0f04005) when executing the
..Send method. Googling the hex error gave zero results and
Googling the decimal error yielded runtime errors with
differing numbers, none of which were relevant.

Clicking on Help from the error dialog brings up help on error
440 - Automation.

The text of the error is: Outlook does not recognize one or more
names. Googling this yields a Microsoft support page suggesting
that the address book is corrupt. I can successfully send e-mail
directly from OL and the sole test recipient is my own email
address which does appear in my address book.

Dim objOut As Outlook.Application
Dim objOutMsg As Outlook.MailItem
Dim strRecipient As String, strSubject As String
Dim strBody As String
Dim blnDisplayMsg As Boolean

blnDisplayMsg = Me.chkDisplay 'do we display the email
first
Set objOut = CreateObject("Outlook.Application") 'Create Outlook session
....
Set objOutMsg = objOut.CreateItem(olMailItem) 'create Outlook message
With objOutMsg
.recipients.Add strRecipient 'To field
.subject = strSubject 'Subject field
.body = strBody 'Body field
If blnDisplayMsg Then 'display before sending
.Display
Else 'just send it
.Save
===> .Send
End If
End With 'done with this message
'erase just sent msg from memory
Set objOutMsg = Nothing

If I send the logic through the .Display method instead, OL fires
and the fields are correctly populated. Clicking on the [Send]
button has the expected result. However, requiring the user to
click send on multiple messages somewhat defeats the purpose.

Where to from here?
 
D

De Jager

.Len B said:
I have the following code (stolen from MS KB161088) which fails
with error code -1594867707 (a0f04005) when executing the
.Send method. Googling the hex error gave zero results and
Googling the decimal error yielded runtime errors with
differing numbers, none of which were relevant.

Clicking on Help from the error dialog brings up help on error
440 - Automation.

The text of the error is: Outlook does not recognize one or more
names. Googling this yields a Microsoft support page suggesting
that the address book is corrupt. I can successfully send e-mail
directly from OL and the sole test recipient is my own email
address which does appear in my address book.

Dim objOut As Outlook.Application
Dim objOutMsg As Outlook.MailItem
Dim strRecipient As String, strSubject As String
Dim strBody As String
Dim blnDisplayMsg As Boolean

blnDisplayMsg = Me.chkDisplay 'do we display the email
first
Set objOut = CreateObject("Outlook.Application") 'Create Outlook session
...
Set objOutMsg = objOut.CreateItem(olMailItem) 'create Outlook message
With objOutMsg
.recipients.Add strRecipient 'To field
.subject = strSubject 'Subject field
.body = strBody 'Body field
If blnDisplayMsg Then 'display before sending
.Display
Else 'just send it
.Save
===> .Send
End If
End With 'done with this message
'erase just sent msg from memory
Set objOutMsg = Nothing

If I send the logic through the .Display method instead, OL fires
and the fields are correctly populated. Clicking on the [Send]
button has the expected result. However, requiring the user to
click send on multiple messages somewhat defeats the purpose.

Where to from here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top