• Access to Outlook email error (2002)

    Author
    Topic
    #454709

    Hi,

    I’m working on a database that is set up to email outlook via access and its been working fine. Now the user is getting the following error and I’m not sure what the issue is:
    Function SendMail( _
    Recipient As String, _
    Subject As String, _
    Message As String, _
    Attachment As String, _
    Optional ShowMail As Boolean) As Boolean

    Dim objOL As Outlook.Application
    Dim objMI As Outlook.MailItem
    Dim blnNotActive As Boolean
    Dim intPos1 As Integer, intPos2 As Integer

    The first 6 lines are hightlighted in yellow.

    I’ve attached a screen shot of the reference library.

    Viewing 0 reply threads
    Author
    Replies
    • #1129491

      You should have a reference to the Microsoft Outlook 10.0 Object Library instead of to the Microsoft Outlook View Control.

      • #1129684

        Hi Hans,

        I made the change you recommended and that worked for the email, however now they are getting an error when they go to fax and I’m not sure if its at all related. The error states its a compile error, use type not defined. I’m attaching a screen shot. I didn’t write this software so I’m not sure where to begin. They are faxing via the Access software and its been working fine up until now.

        Thanks,
        Leesha

        • #1129685

          Clear the check boxes for OLE Automation and Microsoft Visual Basic for Applications Extensibility 5.3. They aren’t necessary.
          Scroll down the list until you see Microsoft DAO 3.6 Object Library and tick its check box. Then click OK.

          It’s best to change the declaration of rs from

          Dim rs As Recordset

          to

          Dim rs As DAO.Recordset

          It won’t make any difference at the moment, but it can help to avoid problems in the future.

          • #1129686

            Hans you are the most wonderful man! This user’s business depends on getting these faxes out and this was so out of my league!!
            Thanks for the quick response.

            Leesha

    Viewing 0 reply threads
    Reply To: Access to Outlook email error (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: