By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

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

P: 6
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.061101-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.040803-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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub MySendEmail_Click()
  2.     Dim stDocName As String
  3.     Dim stLinkCriteria As String
  4.     Dim Subject As String
  5.     Dim message As String
  6.  
  7.     If IsNull([email]) Or ([email]) = "" Then
  8.        MsgBox "There is no E-mail address entered for this person!"
  9.        Exit Sub
  10.     Else
  11.        stLinkCriteria = [Forms]![EmailForm]![email]
  12.        stSubject = "Re: Your Application"
  13.        stMessage = [Forms]![EmailForm]![message]
  14.        DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stSubject, stMessage, True
  15.     End If
  16. End Sub
  17.  
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.
Mar 29 '09 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,494
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!
Apr 4 '09 #2

P: 6
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.
Apr 4 '09 #3

NeoPa
Expert Mod 15k+
P: 31,494
No worries. I hope it helps.

Good luck with your project :)
Apr 4 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.