Hi,
I have the code below and I need help to modify it by
1) adding a line telling the macro to attach a cetain file from my desktop ( for example C:\test.pdf )
2) I would like to change the charecters inside the mails for some lines to bold
Can anyone help please. Thank you in advance
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 Notification() Dim Email As String, Subj As String Dim Msg As String, URL As String Dim r As Integer, x As Double NumOfRows = Sheets("mail template").Cells(Rows.Count, 2).End(xlUp).Row For r = 2 To NumOfRows Email = Cells(r, 3) Subj = "Assigned to You" Msg = "" & vbCrLf & vbCrLf Msg = Msg & "Dear XY," & vbCrLf & vbCrLf Msg = Msg & "Your are requested to contact you department's manager " & Cells(r, 15) & " for review." & vbCrLf & vbCrLf Msg = Msg & "Please contact the interviewer promptly" & vbCrLf & vbCrLf Msg = Msg & "Candidate: " & Cells(r, 3) & vbCrLf Msg = Msg & "Capability: " & "forums" & vbCrLf Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20") Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20") Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A") URL = "mailto:" & Email & "?cc=mail@mail.com" & "?subject=" & Subj & "&body=" & Msg ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus Application.Wait (Now + TimeValue("0:00:02")) Application.SendKeys "%s" Next r End Sub




Reply With Quote
Bookmarks