簡體   English   中英

使用 Excel VBA 通過 Lotus Notes 發送電子郵件

[英]Sending email via Lotus Notes using Excel VBA

我一直在研究如何通過 Lotus Notus 發送電子郵件,但我的數據庫是錯誤的。

我試圖把“”,“”沒有成功。

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

在 VBA 中不能使用 "","" 來標識數據庫。 這僅適用於在 Notes 客戶端或 Domino 服務器上運行的 LotusScript 代碼。

並且“C:\\Program Files (x86)\\IBM\\Lotus\\Notes.exe”不是數據庫。 這是一個程序。 這是Notes程序。 數據庫是名稱以“.NSF”結尾的文件。

如果要打開當前用戶的個人電子郵件數據庫,則應使用 NotesDatabase 的OpenMail方法在此處輸入鏈接描述類。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM