Without Lotus notes password , send mail through vba excel

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

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.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top