Solved

DoCmd.SendObject error

Posted on 2001-09-13
4
677 Views
Last Modified: 2012-06-27
When using sendobject my code for some reason gives me this error

Run time error 2287 % can't open the mail session

This is only occuring on one of the 5 machines I have installed it on.
So far the things I have tried are making sure outlook express is the default mail program (has to be to work properly)
A microsoft KB article said something about the registry but I have ruled that one out by installing on a 6th machine.

I am completly stuck on this one so any help would be appreciated. I am using Access 2000 if anyone wanted to know and it is installed on a WinME machine.

Just to reiterate my code works fine sending the email on 5 other machines so it is not the code that is wrong but something to do with the setup of the machine.

TIA

Ewen.
0
Comment
Question by:ph0bia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
gallaghe earned 50 total points
ID: 6490508
If you want to send an email from MS-Access

Const SW_SHOWNORMAL = 1

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
   (ByVal hwnd As Long, _
   ByVal lpOperation As String, _
   ByVal lpFile As String, _
   ByVal lpParameters As String, _
   ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
   If ShellExecute(Me.hwnd, "open", _
                   "mailto:SomeOne@Here.com" & _
                   "?Subject=Learning how to get rid of first body line" & _
                   "&cc=Goofy" & _
                   "&bcc=Dilbert" & _
                   "&body="Your message goes here.", _
                   vbNullString, _
                   vbNullString, _
                   SW_SHOWNORMAL) <= 32 Then
      MsgBox "Some error message"
   End If
End Sub

or check out
http://www.granite.ab.ca/access/email.htm

Kevin
0
 

Author Comment

by:ph0bia
ID: 6490571
I'd rather not change any of my code because the system is already being run on 5 other machines in the company. I want to try and get it to work like the others on this one machine. It runs fine on Win98, WinNT and on one WinME box.... just not this one!
0
 
LVL 2

Expert Comment

by:gallaghe
ID: 6490606
ShellExecute is non-discriminatory as oppose to SendObject, you might consider it rather then getting the broken one to work.
0
 

Expert Comment

by:bundy01
ID: 7354918
I had the same problem and found the Run time error 2287 caused by the [Mail] setting in win.ini file

An NT box was missing variables that caused Run time error 2287 % can't open the mail session, whilst another WinMe machine was fine

The faulty machine win.ini had the follwoing entry
[Mail]
MAPI=1

The working machine win.ini file looked like

[Mail]
MAPI=1
MAPIX=1
OLEMessaging=1
CMC=1
CMCDLLNAME=mapi.dll
CMCDLLNAME32=mapi32.dll
MAPIXVER=1.0.0.1


As soon as I changed the win.ini file the problem was fixed.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question