A
Al Jager
Sorry, The previous posting "escaped" before I could
complete my request.
In the macro I refer to the file that has to be attached.
Instead of pointing to the file using the path etc. I want
to attach the active workbook.
Could someone tell me how to to that please?
Many thanks.
Al
Sub SendMail()
Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient = objMailItem.Recipients.Add
(ActiveSheet.Range("B2").Value)
objRecipient.Type = 1 '1 = To, use 2 for cc
objMailItem.Subject = "The extract has finished."
'Instead of the path to the file -
' I want to insert Active Workbook in the next line
objMailItem.Attachments.Add ("C:\Al Jager\! Book
Test1.xls")
objMailItem.Display
End Sub
complete my request.
In the macro I refer to the file that has to be attached.
Instead of pointing to the file using the path etc. I want
to attach the active workbook.
Could someone tell me how to to that please?
Many thanks.
Al
Sub SendMail()
Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient = objMailItem.Recipients.Add
(ActiveSheet.Range("B2").Value)
objRecipient.Type = 1 '1 = To, use 2 for cc
objMailItem.Subject = "The extract has finished."
'Instead of the path to the file -
' I want to insert Active Workbook in the next line
objMailItem.Attachments.Add ("C:\Al Jager\! Book
Test1.xls")
objMailItem.Display
End Sub