Run-time error '2287': can't open the mail session

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frisco Depot
    New Member
    • Mar 2009
    • 6

    Run-time error '2287': can't open the mail session

    I have a Run-time error problem on a Vista computer.

    There are two computers involved,

    The first one is Vista Home Premium SP1 with
    Windows Mail Version 6.0.6000.16386 (vista_rtm.0611 01-2205)
    and Access 2000 (9.0.2720) with the following References selected:
    Visual Basic for Applications
    MS Access 9.0 Object Library
    MS DAO 3.6 Object Library
    OLE Automation
    MS ActiveX Data Objects 2.1 Library
    MS Word 11.0 Object Library
    MS Outlook 9.0 Object Library

    The second is XP Professional Version 2002 SP2
    with Outlook Express 6 Version 6.00.2900.2180 (xpsp_sp2_rtm.0 40803-2158) and Access 2000 (9.0.2720) with the following References selected:
    Visual Basic for Applications
    MS Access 9.0 Object Library
    MS DAO 3.6 Object Library
    OLE Automation
    MS ActiveX Data Objects 2.1 Library
    MS Word 11.0 Object Library
    MS Outlook 11.0 Object Library

    I have an Access Form with a Command Button to send email with the following code.

    Code:
    Private Sub MySendEmail_Click()
        Dim stDocName As String
        Dim stLinkCriteria As String
        Dim Subject As String
        Dim message As String
        
        If IsNull([Email]) Or ([Email]) = "" Then
           MsgBox "There is no E-mail address entered for this person!"
           Exit Sub
        Else
           stLinkCriteria = [Forms]![EmailForm]![Email]
           stSubject = "Re: Your Application"
           stMessage = [Forms]![EmailForm]![message]
           DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stSubject, stMessage, True
        End If
    End Sub
    The form and code work just fine on the XP machine.

    The problem is on the Vista machine, with Windows Mail open and working fine, when I click the Command Button I get the following:
    Run-time error '2287': can't open the mail session.

    Note: On the Vista machine, if I use a Command Button with a Hyperlink Address in Properties, It works just fine.


    Any help would be appreciated.
    Last edited by Stewart Ross; Mar 30 '09, 10:38 AM. Reason: Corrected code tags by removing additional spaces
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    I can't supply a reliable answer I'm afraid, but it may be to do with the reference being to Outlook in both cases. I would expect Outlook Express to be similar enough for the library procedures to work ok. I wouldn't expect the same from Windows Mail. I may be wrong, and I don't have any of the software to check with I'm afraid.

    Welcome to Bytes!

    Comment

    • Frisco Depot
      New Member
      • Mar 2009
      • 6

      #3
      Thanks

      Thanks for your reply.
      I will search for a windows mail library that I can reference.
      There was not one listed in references in access.

      Thank you.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        No worries. I hope it helps.

        Good luck with your project :)

        Comment

        Working...