Hi,
This is a routine I have is stored the Init event of a form. I have the Microsoft MAPI Session and Message Control dropped on my form. I named the Session object OLESessionMAPI and the Message object OLEMessageMAPI.
The following routine is supposed to attach a file named "Ca000001.txt" located in the "C:\Email" directory, and send it out to an internet recipient, "
vlahosj@total.net".
Can anyone tell me why this code is failing at run time at the
".Send()" event? Has anyone else had problems getting the MAPI Activex to work?
The error message I get is "OLE error code 0x80020010:Invalid callee.".
I've tried this on several workstations, all with internet connections using MS-Exchange with the proper 32-bit MAPI DLLs installed.
NOTE: The user name and password are not the reall ones.
>
ThisForm.OLESessionMAPI
.LogonUI=.F.
.NewSession=.F.
.Username="TestUsername"
.Password="TestPassword"
.SignOn()
ENDWITH
WITH ThisForm.OLEMessageMAPI
.SessionID = ThisForm.OLESessionMAPI.SessionID
.Compose()
.MsgType = ""
.MsgSubject = "CAMPAIGN FILES"
.MsgNoteText = "Here it is..."
.AttachmentIndex = .AttachmentCount + 1
.AttachmentName = "Ca000001.txt"
.AttachmentPathName = "C:\Email\Ca000001.txt"
.AttachmentPosition = 12
.AttachmentType = 0
.RecipIndex = .RecipCount + 1
.RecipAddress = "
vlahosj@total.net"
.RecipDisplayName = "John Vlahos"
.RecipType=1
.Send()
ENDWITH
ThisForm.OLESessionMAPI.SignOff
ThisForm.Release()
<
Thank you,
John Vlahos