Lotus Notes VBA

Ruy

New Member
Joined
Aug 24, 2020
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Dear,

I'm new on VBA but I've been studying how to send email through VBA.
I know my database is wrong but where should I take such information? I already tried to put " " but without success.


VBA Code:
Dim MailData As Object 'The email database
Dim Maildoc As Object 'The email itself
Dim Session As Object 'The notes session
    
linha = 2

Do Until Cells(linha, 1) = ""

Set Session = CreateObject("Notes.NotesSession")
Set MailData = NotesSession.GetDatabase("", "C:\Program Files (x86)\IBM\Lotus\Notes.exe")

    If MailData.IsOpen = True Then
    Else
    MailData.Openmail
    
    End If


Set Maildoc = MailDB.CreateDocument
    Maildoc.SendTo = Cells(linha, 8)
    Maildoc.Subject = "SYMRISE BR - Quotation" & " -" & Cells(linha, 1) & " -" & Cells(linha, 4)
    Maildoc.Body = "Dears, & Chr(10) & Chr(10) & Cells(15,14) & Chr(10) & Chr(10) & Cells(1,1) & "" & Cells(linha, 1) & "
    Chr (10) & Cells(1, 2) & "" & Cells(linha, 2) & Chr(10) & Cells(1, 3) & "" & Cells(linha, 3) & Chr(10) & _
    Cells(1, 4) & " " & Cells(linha, 4) & Chr(10) & Cells(1, 5) & " " & Cells(linha, 5)
    

Maildoc.SaveMessageonSend = True

    
Loop
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Welcome to MrExcel forums.

Change:
VBA Code:
Set MailData = NotesSession.GetDatabase("", "C:\Program Files (x86)\IBM\Lotus\Notes.exe")
to:
VBA Code:
Set MailData = Session.GetDatabase("", "")
There should be several threads on the Excel Questions and General Discussion forums for sending emails with Lotus Notes. Search for something like "Lotus Notes email".
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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