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

Email compatibility

Status
Not open for further replies.

JoanieB

Programmer
Apr 17, 2001
57
0
0
US
CAN ANYONE ANSWER THIS QUESTION? I need to know about Access's compatibility with various email systems. We have Lotus Notes and were wondering how (if) we could incorporate emailing procedures into a program. {I don't believe Access 97 can use anything other than Windows based email?} If Access (97) is not able to accomodate Lotus Notes, can XP? We are upgrading within the next year.
Thanks.
 
The following will allow you to use lotus notes (email) through an A97 form. It also works with both A2K and AXP.

This code works for me, only if Lotus is open, otherwise it gives the
user a message to open notes and then press the button again.

The code is a little cumbersome, but its what I have gotten to work.
the me! references are to fields on a form and this is the code behind
a button on the form.

Private Sub SendMail2Cmd_Click()
On Error GoTo Err_SendMail2Cmd_Click
Dim session As Object
Dim mydoc As Object
Dim db As Object
Set session = CreateObject("notes.notessession")
Set db = session.CurrentDatabase
If TypeName(db) = "Nothing" Then
MsgBox ("Please Open your lotus mail and then press the send mail
button again.")
Set session = Nothing
Set db = Nothing
Set mydoc = Nothing
Exit Sub
End If
Set mydoc = db.CreateDocument()
mydoc.AppendItemValue "subject", CStr(Me!SubjectBx)
mydoc.AppendItemValue "body", CStr(Me!BodyBx) & Chr(13) & CStr(Me!
Body1Bx) & Chr(13) & CStr(Me!Body2Bx)
mydoc.SaveMessageOnSend = True
mydoc.Send False, CStr(Me!ToBx)
MsgBox ("Mail has been sent")
Set session = Nothing
Set db = Nothing
Set mydoc = Nothing

Exit_SendMail2Cmd_Click:
Exit Sub

Err_SendMail2Cmd_Click:
MsgBox Err.Description
Resume Exit_SendMail2Cmd_Click

End Sub

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I don't have Lotus Notes, so I can't test it, but isn't it possible to use a Shell to open Lotus Notes if it's not already open?
And...just a thought...shouldn't CreateObject start the application session?

start:
Set session = CreateObject("notes.notessession")
Set db = session.CurrentDatabase
If TypeName(db) = "Nothing" Then
shell "lotus.exe"
Set session = Nothing
Set db = Nothing
Set mydoc = Nothing
GoTo start
End If

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Thank you thornmastr - that code put me right on track. I haven't tried the open notes suggestion yet, but thank you both!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top