pulsecoding
New Member
- Joined
- May 26, 2011
- Messages
- 31
Hi,
Pls let me know code to send Lotus notes mail through VBA excel without prompting requestors lotus notes password.
Lotus notes is open at the requestors machine
below is the code I managed , but it is giving error at the pink highlighted line
thanks for your time to my post.
Abhijeet.
Pls let me know code to send Lotus notes mail through VBA excel without prompting requestors lotus notes password.
Lotus notes is open at the requestors machine
below is the code I managed , but it is giving error at the pink highlighted line
Code:
Dim user As String, server As String, mailfile As String
Dim domSession As New NotesSession
'Dim domNotesDBMailFile As NotesDatabase
Dim domNotesDBMailFile As Object
Dim domNotesDocumentMemo As NotesDocument
Dim domNotesRichText As NotesRichTextItem
Dim strAttachment As String
'Creates a Notessession Object and provides mail details
Set session = CreateObject("notes.notessession")
user = session.UserName
server = session.GetEnvironmentString("MailServer", True)
mailfile = session.GetEnvironmentString("MailFile", True)
'''Set db = session.GetDatabase(server, mailfile)
Set domNotesDBMailFile = session.GetDatabase(server, mailfile)
''' mailfile = Mid(mailfile, 6, 10)
'''Set domNotesDBMailFile = session.GetDatabase(server, mailfile)
'''Set domNotesDBMailFile = session.GetDatabase("", "names.nsf")
'''MsgBox "Enter your Lotus notes password in next window"
'''domSession.Initialize ("") 'Prompts user for Lotus Notes Password
'''Set domNotesDBMailFile = domSession.GetDatabase("", "names.nsf")
Set domNotesDocumentMemo = domNotesDBMailFile.CreateDocument
Call domNotesDocumentMemo.AppendItemValue("Form", "Memo")
'Call domNotesDocumentMemo.AppendItemValue("SendTo", domSession.CommonUserName)
Call domNotesDocumentMemo.AppendItemValue("SendTo", "abhijeet kadam")
Call domNotesDocumentMemo.AppendItemValue("Subject", strBOdocument)
Set domNotesRichText = domNotesDocumentMemo.CreateRichTextItem("Body")
'strAttachment = strBOUserDocsPath & strBOdocument & ".xls"
'Call domNotesRichText.EmbedObject(EMBED_ATTACHMENT, "", strAttachment, "")
domNotesRichText.AppendText (ActiveWorkbook.Sheets("Details").Cells((ActiveWorkbook.Sheets("Details").Cells(2, 5).Value + 3), 1).Value)
domNotesRichText.AppendText (" ")
domNotesRichText.AppendText (ActiveWorkbook.Sheets("Details").Cells((ActiveWorkbook.Sheets("Details").Cells(2, 5).Value + 3), 2).Value)
domNotesRichText.AppendText (" ")
domNotesRichText.AppendText (ActiveWorkbook.Sheets("Details").Cells((ActiveWorkbook.Sheets("Details").Cells(2, 5).Value + 3), 3).Value)
domNotesRichText.AppendText (" ")
domNotesRichText.AppendText (ActiveWorkbook.Sheets("Details").Cells((ActiveWorkbook.Sheets("Details").Cells(2, 5).Value + 3), 4).Value)
domNotesDocumentMemo.Send (False)
End Sub
thanks for your time to my post.
Abhijeet.