I have a problem this macro works perfectly when you email to someone BUT when it emails in the Subject bar it does not pick up the name of the workbook. You know how when open your workbook then you go to FILE then SEND TO then you choose MAIL RECIPIENT (AS ATTACHMENT) Then that box pops up and in the subject bar the name of the file is in there. This code does not put the name of the file in the SUBJECT bar. Any one has a idea to modified this code?
Thanks!
Public Sub MyOutlook()
Dim AppOutlook As Object
Set AppOutlook = CreateObject("Outlook.application")
With AppOutlook.CreateItem(olMailItem)
.To = "noone@home.com"
.Subject = "Sheet: " & ws.Name
'Populate your attachment the way you like as shown at the http://www.rondebruin.nl/mail/folder2/mail1.htm web site.
'just one example is shown below.
.AddAttachment WBname
.Send
End With
Set AppOutlook = Nothing
End Sub
Thanks!
Public Sub MyOutlook()
Dim AppOutlook As Object
Set AppOutlook = CreateObject("Outlook.application")
With AppOutlook.CreateItem(olMailItem)
.To = "noone@home.com"
.Subject = "Sheet: " & ws.Name
'Populate your attachment the way you like as shown at the http://www.rondebruin.nl/mail/folder2/mail1.htm web site.
'just one example is shown below.
.AddAttachment WBname
.Send
End With
Set AppOutlook = Nothing
End Sub