0
votes

I've been studying how to send emails via Lotus Notus but my database is wrong.

I tried to put "", "" without success.

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
1

1 Answers

0
votes

You can't use "","" to identify a database in VBA. That works only in LotusScript code that is running inside the Notes client or on a Domino server.

And "C:\Program Files (x86)\IBM\Lotus\Notes.exe" isn't a database. It's a program. It's the Notes program. A database is a file with a name that ends with ".NSF".

If you want to open the current user's personal email database, then you should be using the OpenMail method of the NotesDatabaseenter link description here class.