Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

F1 - MAPI gives error in the Send Command

Status
Not open for further replies.

Deadline

Programmer
Feb 28, 2001
367
US
Hi

I am getting the following error when the Send command executes.

-2147417848
Automation error
The object invoked has disconnected from its clients.


Here is the code:

With MAPISession1
.DownLoadMail = False
.LogonUI = False
.SignOn
.NewSession = True
MAPIMessages1.SessionID = .SessionID
End With
With MAPIMessages1
.Compose
.RecipAddress = "helpmeplease@urgent.com"
.MsgSubject = strMailSubject
.MsgNoteText = strMailText
.Send False '<<<Gettting that error here
End With

Why does this error occur and what is the possible remedy ?


Thank you in Advance.

RR
:-(
 
Hi Eric,

Actually this program is supposed to be converted as an EXE and will be running as a Task in the Task Scheduler at the mid of night everyday.

Hence there are no visible controls on the form. Not even Logon. I am trying to simulate CDONTS here.

The false for Send command is to suppress the Dialog. I tried it with True, even then I get the same error.


Thanks in advance.


RR
:-|


 
Maybe you see the problems :

Example :

Log-On :

With mapSess
' Set DownLoadMail to False to prevent immediate download.
.DownLoadMail = False
.LogonUI = True ' Use the underlying email system's logon UI.
.SignOn ' Signon method.
' If successful, return True
LogOn = True
' Set NewSession to True and set0
' variable flag to true
.NewSession = True
bNewSession = .NewSession
mapMess.SessionID = .SessionID ' You must set this before continuing.
sbrMapi.Panels(&quot;SessID&quot;) = &quot;ID = &quot; & .SessionID ' Just so you can see the SessionID.
End With

' Logoff the MapSessions control.
With mapSess
.SignOff ' Close the session.
.NewSession = False ' Flag for new session.
bNewSession = .NewSession ' Reset flag.
End With

Before the code you paste here have you a declaration As CreateObject ? Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Eric,

The development machine doesn't has Outlook 97 or 2000. It just has Visual Studio and Access and stuff like that. This program will be deployed in a NT server.

And I included a MAPI Session control and MAPI MEssage control. I did not use CreateObject.

Thank you


RR
:-|
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top