Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Access

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB
Good Day

I was hoping someone could please assist. I am currently creating a send email via form. But just dont seem to get passed the following error and hoped someone could perhaps assit.

I am using Access 2003
Exchange Server

And set all the necessary references within my module i.e
Microstof Outlook 11 Object Library.

I am trying to run the following code via a command after my fields have been filled in but get the Following error:

Run Time Error - 2147024770 (8007007e)
Automation Error
The Specific Module could not be found

and upon selecting debug takes me to the following line within the code

Code:
 Set appOutLook = CreateObject("Outlook.Application")


Code:
Private Sub SendEmail_Click()


        Dim mess_body As String
        Dim appOutLook As Outlook.Application
        Dim MailOutLook As Outlook.MailItem
       Set appOutLook = CreateObject("Outlook.Application")
       Set MailOutLook = appOutLook.CreateItem(olMailItem)
            
             With MailOutLook
            .BodyFormat = olFormatRichText
            .To = Me.Email_Address
            .CC = Me.CC_Address
            .BCC = Me.BCC_Address
            .Subject = Me.Mess_Subject
            .HTMLBody = Me.mess_text
            If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
                .Attachments.Add (Me.Mail_Attachment_Path)
            End If
            .Send
            End With
            'MsgBox MailOutLook.Body
            Exit Sub
email_error:
            MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
            Resume Error_out
Error_out:
End Sub

Any advise would be appreciated

Kind Regards
Natural
 
have you included a reference to the outlook library?


--------------------
Procrastinate Now!
 
Thanks for the advise sofar

I have added reference to Microsoft Office 11 _ Not change still get same error

And Crowley thanks Not to sure "How do i include a reference to the outlook library".

The references i have now is

Microsoft Office 11 Object Library
Microsoft Outlook 11 Object Library
Microsoft Access 11 Object Library
Microsoft DAO 3.6 Object Library
Microsoft Active X Data Objects 2.1 Library
Microsoft ADO Extension 2.8 for DLL and Sec
Microsoft Office Outlook View Control
Microsoft Olap Designer Server Driver 8
OLE Automation
Visual Basics for Applications

Thanks in Advance
SN
 
What is this ?
Microsoft Office Outlook View Control

BTW, Outlook is monoinstance and thus I think you have to play with the GetObject function if Outlook is already open.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top