Hi,
I have the following code for sending a mail as per my requirement from an excel file
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"
'Execute the URL (start the email client) ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
'Wait two seconds before sending keystrokes 'Application.Wait (Now + TimeValue("0:00:02")) 'Application.SendKeys "%s" End Sub
What I want is, I need to insert a file in the mail. The path along with the file name will be given in the A12 cell of "Work" tab.
it will be something like this D:\Kitkat\New folder\ABC.zip
can you please help me to modify this code for that?
And this code is not working in our new laptops but in old only eventhough both have same excel version. After googleing, I understood that, it is because of the difference in IE version. Is there any way to make this work in both?
Please make the Post as solved, when you get your answer & Click * if you like my suggestion
Bookmarks