I have searched, and I admit, I may not be using correct keywords, but looking for the correct line of code that when button is clicked it will take the name of the workbook file I am using and in the SUBJECT line of the email show " thefilename.xxx is now prepared for review". I have tried a few ideas, but nothing seems to work.
I am enclosing the code I am using as I have seen a multitude of codings of how to send the email. BTW--- sending the email works perfectly upon button click. Just hoping to add the file name to subject.
Private Sub sendEmailtoIC_Click() On Error GoTo ErrHandler ' SET Outlook APPLICATION OBJECT. Dim objOutlook As Object Set objOutlook = CreateObject("Outlook.Application") ' CREATE EMAIL OBJECT. Dim objEmail As Object Set objEmail = objOutlook.CreateItem(olMailItem) With objEmail .To = "[email protected]" .cc = "[email protected]" .cc = "[email protected]" .Subject = "thefilename Report Prepared for Review" .Body = "" .Send End With ' CLEAR. Set objEmail = Nothing: Set objOutlook = Nothing ErrHandler: ' End Sub
thanks in advanc e