Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button - Send and Save
Hi! I am using Lotus Notes and am unable to get a Command Button to
send. I've created a document that has to be approved by the recipient and then sent to a designated email address, with the subject included. Can anyone help me? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button - Send and Save
please show us your code
"DDGWms" wrote: Hi! I am using Lotus Notes and am unable to get a Command Button to send. I've created a document that has to be approved by the recipient and then sent to a designated email address, with the subject included. Can anyone help me? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button - Send and Save
Here is the latest version of what has "evolved"...
Dim objNotesSession As Object Dim objNotesMailFile As Object Dim objNotesDocument As Object Dim objNotesField As Object Function SendMail() On Error GoTo SendMailError EMailSendTo = " '' Required - Send to address EMailCCTo = " ''Establish Connection to Notes Set objNotesSession = CreateObject("Notes.NotesSession") ''Establish Connection to Mail File '' .GETDATABASE("SERVER", "FILE") Set objNotesMailFile = objNotesSession.GETDATABASE("", "") ''Open Mail objNotesMailFile.OPENMAIL ''Create New Memo Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT ''Create 'Subject Field' Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject", EMailSubject) ''Create 'Send To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EMailSendTo) ''Create 'Copy To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EMailCCTo) ''Create 'Body' of memo Set objNotesField = objNotesDocument.CREATERICHTEXTITEM("Body") With objNotesField .APPENDTEXT "Approved payroll time and attendance data" End With ''Attach the file --1454 indicate a file attachment ''objNotesField = objNotesField.EMBEDOBJECT(1454, "", "C:\Temp \test.xls") objNotesField = objNotesField.EMBEDOBJECT(1454, "", ActiveWorkbook.FullName) ''Send the e-mail objNotesDocument.Send (0) ''Release storage Set objNotesSession = Nothing Set bjNotesSession = Nothing Set objNotesMailFile = Nothing Set objNotesDocument = Nothing Set objNotesField = Nothing ''Set return code SendMail = True Exit Function SendMailError: Msg = "Error # " & Str(Err.Number) & Err.Source & Chr(13) & Err.Description MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext SendMail = False End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Command Button - Macro to print to pdf, then send pdf to email. | Excel Discussion (Misc queries) | |||
Send keys from command button | Excel Worksheet Functions | |||
Send Open Spreadsheet using Command button | Excel Discussion (Misc queries) | |||
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() | Excel Discussion (Misc queries) | |||
Use command button to send email | Excel Programming |