I am trying to use excel to create an outlook message based on a template. I am not a programmer but have put together macros based on postings I've found online. I'll post the current macro code. It's only creating the entry on the last line from the excel sheet.I am trying to use excel to create an outlook message based on a template. I am not a programmer but have put together macros based on postings I've found online. I'll post the current macro code. It's only creating the entry on the last line from the excel sheet.
also, from excel worksheet
Column A= email address
Column B= email subject
Sub Send_Email_to_List()
Dim TemplName As String
Dim FolderName As String
Dim MeetingDate
Dim FirstNames As String
Dim LastName As String
Dim NextMeetingDate As String
Dim NextMeetingTime As String
Dim enviro As String
Dim OL As Object, MailSendItem As Object
' create file location for template
'
enviro = CStr(Environ("USERPROFILE"))
FolderName = "\Box Sync\Templates\"
TemplName = "Meeting Summary.oft"
strtemplatename = enviro + FolderName + TemplName
Set OL = CreateObject("Outlook.Application")
Set MyItem = OL.CreateItemFromTemplate(strtemplatename)
For Each xCell In ActiveSheet.Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
With MyItem
.To = xCell.Value
.Subject = Cells(xCell.Row, 3).Value
.Save
End With
Next xCell
Set OL = Nothing
[/CODE]End Sub