Solved

DoCmd.SendObject error

Posted on 2001-09-13
4
672 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now