Regarding the original version: http://spreadsheetpage.com/index.php...il_from_excel/
This is what I have so far:
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 Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 5 To 9 'data in rows 2-4
' Get the email address
Email = Cells(p, 5)
' Message subject
Subj = "Informational Interview Request"
' Compose the message
Msg = ""
Msg = Msg & "Hello" & Cells(r, 5) & "," & vbCrLf & vbCrLf
Msg = Msg & "I'm a student with prior experience in industry. I came across your profile on LinkedIn and I was wondering if you would be open to a brief phone call. I would really appreciate speaking about your current role and experience. I have attached my resume for your consideration."
Msg = Msg & "Regards, & vbCrLf"
Msg = Msg & "my name"
' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute Mail&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub
I'm trying to build a networking workbook that is able to send mass emails to contacts in areas of industry that I want to work in.
My question is, how do I edit this macro to run using Apple Mail and add an attachment (pdf version of a resume) to every email sent? I also want to schedule this macro to run at a specific time, I'm assuming the code here would suffice? http://www.ozgrid.com/Excel/run-macro-on-time.htm
In addition to writing new code for Apple Mail and attaching a pdf file, I'm having trouble editing this portion of code to fit within my needs:
Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
' 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"
Next r
Thanks a ton!
Bookmarks