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!

Hi, I need to connect to Lotus 1

Status
Not open for further replies.

five5

Programmer
Feb 9, 2003
2
US
Hi,
I need to connect to Lotus Notes email client through VB and embed a document in RTF/HTML format and send the mail via Lotus Notes email server.It is possible to connect to Microsoft outlook through micrsofot outlook component. Can anybody can help me out? Are there any components available through which I can connect to lotus notes email client s/w and also emebed a document in HTML or RTF format?

Thanks in advance.
 
This may or may not help you with what you are trying to do. this is the code that I use to connect to the current users Lotus email account to send a document. Hope it helps.

email = InputBox("Enter the e-mail address of the recipient", vbOKCancel)
If email = "" Then
Exit Sub
End If
'set up session
Dim session
'create the object
Set session = CreateObject("Lotus.NotesSession")
'initialize the session user will have to enter their lotus notes password
Call session.Initialize(LCase(password))
'Call session.Initialize
'establish which database to use
Dim MailDB As NotesDatabase
emailuser = session.GetEnvironmentString("MailFile", True)
'emailuser = "mail\" & usersname ".nsf"
Set MailDB = session.GetDatabase("lotus database name", emailuser)
Dim Memo As NotesDocument
Dim Item As NotesItem
Dim rtitem As NotesRichTextItem
Dim objFile As NotesEmbeddedObject
Set Memo = MailDB.CreateDocument
subjectinfo = whateverthesubjectis
Set Item = Memo.ReplaceItemValue("SendTo", email)
Set Item = Memo.ReplaceItemValue("Subject", subjectinfo)

Set rtitem = Memo.CreateRichTextItem("Body")
rtitem.AddNewLine (2)
'this area appends the bitmap file as an attachment to the email
breakpoint = InStr(1, CommonDialog1.FileName, ".")
fileext = Right(CommonDialog1.FileName, Len(CommonDialog1.FileName) - breakpoint + 1)
For A = 1 To maxindex
strNewFile = Mid(CommonDialog1.FileName, 1, breakpoint - 1) & "Page" & CStr(A) & fileext
Set objFile = rtitem.EmbedObject(EMBED_ATTACHMENT, "", strNewFile, "")
Next A
'Set objFile = rtitem.EmbedObject(EMBED_ATTACHMENT, "", CommonDialog1.FileName, "")
Set Item = Memo.ReplaceItemValue("Form", "Memo")
Call Memo.Send(False)
Call Memo.Save(True, False)
'give lotus notes time to do its thing and clean up files
Sleep (3000)
'now clean up the files and delete them from the directory where stored
 
hi flyrodder,
thanks man
i'll let u know it worked or not.
anyway thanks a lot for ur mail.
five5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top