I want to be able to send emails to specified recipients, with subject line, message and attachment. I have written the following macro which extracts data from an excel list and does all of the above except adding a message and I don't know how to.
Any ideas?
PS Running Novell Group Wise & Excel 97
Thanks
Sub Auto_email()
'
' Auto_email Macro
' Macro recorded 12/04/02
Dim strThisCC As String, strSheetName As String
Dim recipients As String, subject As String
Do While True
strThisCC = ActiveCell.Value
If strThisCC = "" Then Exit Sub
'If reaches end of list then stop macro
ActiveCell.Offset(0, 1).Activate
'move to next column which lists the recipients
recipient = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
'move to next column which lists the file names
subject = ActiveCell.Value
strSheetName = strThisCC & "_Budget2003.xls"
'open up next file
Workbooks.Open (strSheetName)
ActiveWorkbook.SendMail recipient, subject
ActiveWorkbook.Close
ActiveCell.Offset(1, -2).Activate
'go to next set of details on the list in excel
Loop
End Sub
Any ideas?
PS Running Novell Group Wise & Excel 97
Thanks
Sub Auto_email()
'
' Auto_email Macro
' Macro recorded 12/04/02
Dim strThisCC As String, strSheetName As String
Dim recipients As String, subject As String
Do While True
strThisCC = ActiveCell.Value
If strThisCC = "" Then Exit Sub
'If reaches end of list then stop macro
ActiveCell.Offset(0, 1).Activate
'move to next column which lists the recipients
recipient = ActiveCell.Value
ActiveCell.Offset(0, 1).Activate
'move to next column which lists the file names
subject = ActiveCell.Value
strSheetName = strThisCC & "_Budget2003.xls"
'open up next file
Workbooks.Open (strSheetName)
ActiveWorkbook.SendMail recipient, subject
ActiveWorkbook.Close
ActiveCell.Offset(1, -2).Activate
'go to next set of details on the list in excel
Loop
End Sub