Hey All,
I've got a working copy of a Workbook which will send an e-mail with attachments through Lotus Notes. The thing I can't figure out is how to view the e-mail before it gets sent.
Any ideas?
Thanks.
Hey All,
I've got a working copy of a Workbook which will send an e-mail with attachments through Lotus Notes. The thing I can't figure out is how to view the e-mail before it gets sent.
Any ideas?
Thanks.
Liverspot,
Try creating it as a draft first and then send it.
Public Function NotesMailNewDraft(strSendTo As Variant, strSubject As Variant, strText As Variant, strcc As Variant, strbcc As Variant, strFilename As String)
Dim objNotes As Object, objNotesDB As Object, objNotesMailDoc As Object
Dim SendItem, NCopyItem, BlindCopyToItem, i As Integer, rtitem
Dim Msg As String
On Error Resume Next
AppActivate "Lotus Notes"
If Not Err.Number = 0 Then
Err.Clear
GoTo ExitF
Else
On Error GoTo ExitF
Set objNotes = GetObject("", "Notes.Notessession")
Set objNotesDB = objNotes.GETDATABASE("", "")
Call objNotesDB.OPENMAIL
Set objNotesMailDoc = objNotesDB.CREATEDOCUMENT
objNotesMailDoc.Form = "Memo"
Call objNotesMailDoc.Save(True, False)
Set SendItem = objNotesMailDoc.APPENDITEMVALUE("SendTo", "")
Set NCopyItem = objNotesMailDoc.APPENDITEMVALUE("CopyTo", "")
Set BlindCopyToItem = objNotesMailDoc.APPENDITEMVALUE("BlindCopyTo", "")
objNotesMailDoc.SendTo = Application.Worksheets("Client Information").Range("EmailAddress").value
objNotesMailDoc.Subject = Application.Worksheets("Client Information").Range("ProjectName").value & " " & Application.Worksheets("Client Information").Range("ProjectNumber").value
Set rtitem = objNotesMailDoc.CREATERICHTEXTITEM("Body")
objNotesMailDoc.Body = Application.Worksheets("Client Information").Range("ContactName").value & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & " " & vbCr & "Regards" & vbCr & " " & vbCr & Application.Worksheets("Client Information").Range("SalesEng").value & vbCr & "WWL"
rtitem.ADDNEWLINE (1)
Call objNotesMailDoc.Save(True, False)
objNotesMailDoc.RemoveItem ("DeliveredDate")
Call objNotesMailDoc.Save(True, False)
Msg = "A draft E-Mail was successfully created and can be found in your Notes Drafts folder!"
MsgBox Msg, vbInformation, "Notesmail Draft..."
Call objNotes.Close
Set objNotes = Nothing
Exit Function
End If
ExitF:
Msg = "A draft E-Mail was not created! Please check your network connection and ensure you are logged into Lotus Notes."
MsgBox Msg, vbInformation, "Notesmail Draft..."
End Function
Sub ClientQuoteEmailNew()
Dim strSendTo, strSubject, strText, strcc, strbcc As String
Dim strFile As String
strSendTo = ""
strSubject = ""
strText = ""
strFile = ""
NotesQuoteNewDraft strSendTo, strSubject, strText, strcc, strbcc, strFile
Exit Sub
End Sub
Display More
Regards
AJW
Re: Email : Viewing Lotus Notes E-Mail Before Sending
I saw your post and I've been trying to work my way around this too. If you still want to get the mail to be up on the screen so you can edit it, use this command:
Set workspace = CreateObject("Notes.NotesUIWorkspace")
Call workspace.EDITDOCUMENT(True, MailDoc).GOTOFIELD("Body")
then delete the send and the save to sent folder or the save to draft folder...this will just bring it up for you to see
Don’t have an account yet? Register yourself now and be a part of our community!