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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAPI Control Problems

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
I am trying to make my app compose a message. Every time I try, I get an error saying, "Valid session ID does not exist." I have tried everything I can think of. Please help. TIA.
 
This I have copied out of a working programme. Compare it to yours.

form1.MAPISession1.SignOn

With form1.MAPIMessages1
.SessionID = form1.MAPISession1.SessionID
.MsgIndex = -1
.Compose
.MsgSubject = "Merge Data"

.RecipDisplayName = cRecip

.ResolveName

c = Space(20) & vbCrLf
c = c & cMailData
c = c & "Message Sent " & Format(Now, "dd mmm yyyy") & " " & Format(Now, "hh mm")
.MsgNoteText = c

.AttachmentIndex = 0
.AttachmentPosition = 0
.AttachmentName = cattach1
.AttachmentPathName = (cAppPath & "database\" & cattach1 )

.AttachmentIndex = 1
.AttachmentPosition = 1
.AttachmentName = cattach2
.AttachmentPathName = (cAppPath & "database\" & cattach2)
If lSendEmailDirect Then
.Send False
Else
.Send True
End If


End With

form1.MAPISession1.SignOff
Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top