Macro to insert one or more files after searching to mail as attachment
Hi,
I have the following macro to send mails to engineers as per the schedule. This code works for Lotus Notes.
What I need is, if I have a list of file names in the form of *1234*.pdf & *737372*.pdf (1234 &737372 can be any numbers which will be in the list mentioned in the excel), it should search for those files in a particular folder Say "D:\New Folder" and attach the results in the mail.(May can have multiple attachement)
PHP Code:
Private Declare Function ShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long
Sub SendEMail() Dim CopiesTo As String Dim Email As String, Subj As String Dim Msg As String, URL As String Email = Cells("1", 51)
Subj = Cells("1", 50)
Msg = "" Msg = Msg & "Dear " & Cells("1", 49) & "," & vbCrLf & vbCrLf & "Your Following delivery is pending for the QC today. " & vbCrLf & vbCrLf & Cells("1", 52) & vbCrLf & vbCrLf & " Please complete it and reply ASAP." & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "NB: This mail will supersede the previous mail if you did get any with the same subject line"
Bookmarks