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

Close LNotes from VB

Status
Not open for further replies.

joemal

Programmer
Feb 12, 2003
13
MT
I am opening and sending message from VB6 through Lotus NOtes. I would like to close the Lotus Notes after sending message automatically from VB. Anyone can help pls?
 
This is part of my code:

Dim db As Object, doc As Object, rtobject As Object, workspace As Object
Dim rtitem As Object
Dim ws As Object

Dim user As String, server As String, mailfile As String

Set Session = CreateObject("notes.notessession")

user = Session.UserName
server = Session.GETENVIRONMENTSTRING("MailServer", True)
mailfile = Session.GETENVIRONMENTSTRING("MailFile", True)

If mailfile = "" Then
mailfile = Session.GetDatabase("", "names.nsf")
End If

Set db = Session.GetDatabase("", "")

If db.ISOPEN = False Then
db.OPENMAIL
End If

Set doc = db.CreateDocument()

doc.Form = "Memo"
doc.Subject = "subject"
Set rtitem = doc.CreateRichTextItem("Attachment")
Call rtitem.EmbedObject(1454, "", rs_msg_value.Fields(0).Value)
doc.SendTo = "test@mail"
Call doc.send(False)

db.Close

Set Session = Nothing
Set workspace = Nothing
Set db = Nothing
Set doc = Nothing

Thanks
 
You are better off using the Domino type library objects. They clean up a lot better ... the code is pretty much identical except you add a reference to the Domino objects and I think the createobject is different.

Unfortunately the code I have is at work and I'm not so I'm just going by memory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top