DoCmd.SendObject acSendNoObject


I am running the following code on two seperate systems. One works the other errors constantly;

If Not IsNull(Me.HD_Email) Then
    strMsg = MsgBox("Do You Want To Send This Customer An Email?", vbYesNo, ConTitle)
        If strMsg = vbNo Then Exit Sub
        DoCmd.SendObject acSendNoObject, , , Me.HD_Email, , , "At Home In London"

        Exit Sub
    MsgBox "No Email Address Found For This Customer", vbOKOnly, ConTitle
    Exit Sub
End If

Using Access 2002. the error message as follows

(From)Microsoft Exchange
The Object Could Not Be Found

Followed by error from Access.
Can't send this message

would appreciate any help

Who is Participating?
dannywarehamConnect With a Mentor Commented:
If so, it may be better to do it through a different code:

'* Set a reference to 'Microsoft Outlook 9.0 Object Library  *
'* (or any other version)                                    *
'* Menu 'Tools', 'References', check the appropriate library *
Private Sub Knop1_Click()
Dim ol As New Outlook.Application
Dim olMail As Outlook.MailItem
Dim strTO As String
Dim strCC As String

   strTO = ""
   'strCC = "" & ";" & ""

    Set olMail = ol.CreateItem(olMailItem)

    With olMail
        .To = strTO
        '.CC = strCC
        '.BCC = ""
        '.Attachments.Add "c:\somefile.txt"
        '.Attachments.Add "c:\somefile2.txt"
        .Subject = "Testing"
        .Body = "This is the body..."
    End With

    Set olMail = Nothing
    Set ol = Nothing

End Sub

I've ' out some of the code, so that you can add or remove it as nessessary
scottsanpedroAuthor Commented:
yep...i've been everywhere :)
Okey doke

What are you trying to do - just send an email without an attachment through Outlook?
scottsanpedroAuthor Commented:
Thanks Danny...looks like it could work

I will check later as away for a bit...thank you and will get back

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.