Can you please help me adding modifying the code to have attach a file to the created mails? Always the same file.
Sub SendQuoteToEmail()
Dim NSession As Object
Dim NDatabase As Object
Dim NUIWorkSpace As Object
Dim NDoc As Object
Dim NUIdoc As Object
Dim WordApp As Object
Dim subject As String
Dim EmailAddress As String
Dim s(1 To 5) As String
Dim r As Integer
Dim x As Double
NumOfRows = Sheets("sheet1").Cells(Rows.Count, 2).End(xlUp).Row
For r = 2 To NumOfRows
subject = Worksheets("sheet1").Range("B2")
EmailAddress = Worksheets("sheet1").Range("c2")
'Debug.Print subject
Set NSession = CreateObject("Notes.NotesSession")
Set NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set NDatabase = NSession.GETDATABASE("", "")
If Not NDatabase.IsOpen Then NDatabase.OPENMAIL
Set NDoc = NDatabase.CREATEDOCUMENT
With NDoc
.SendTo = EmailAddress
.CopyTo = "sami"
.subject = subject
s(1) = "Dear" & " " & Worksheets("sheet1").Range("D2")
s(2) = "Many Thanks for your enquiry"
s(3) = "Please find Attached your Quotation"
s(4) = "If you would like to go ahead with this order, please let me know and I will send you a template, artwork guidelines and procedures for processing your order."
s(5) = " "
.body = Join(s, vbCrLf & vbCrLf) & _
NDatabase.GETPROFILEDOCUMENT("CalendarProfile").GETITEMVALUE("Signature")(0)
.Save True, False
End With
NUIWorkSpace.EDITDOCUMENT True, NDoc
Set NDoc = Nothing
Set WordApp = Nothing
Set NSession = Nothing
Next r
End Sub