After digging and tweaking, I'm able to automate sending of email... but unfortunately the file is not attached... Using gmail coding. I know there's no call to attach the file... but not sure what to do at this point.
Any help or direction is greatly appreciated. Thanks!
Sub Macro10()
'
' Macro10 Macro
' Macro recorded 6/27/2007 by Kiley Murphy
'
'
Sheets("Copy Instructions").Select
Sheets(Array("Copy Instructions")).Select
Sheets(Array("Copy Instructions")).Copy
ActiveWorkbook.SaveAs Filename:= _
"C:" & Range("B9") & "Copy Instructions", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=True
Dim UserName As String
UserName = InputBox("Enter gmail username:")
Dim Password As String
Password = InputBox("Enter gmail password:")
Dim objEmail, objConfig
Set objEmail = CreateObject("CDO.Message")
objEmail.From = UserName
objEmail.To = Range("BV1")
objEmail.Subject = "Instructions For- " & Range("B9") & Format(Date, " dd/mmm/yy")
Do While Len(objEmail.TextBody) = 0
objEmail.TextBody = InputBox("Enter message:")
Loop
Set objConfig = objEmail.Configuration
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = UserName
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Password
objConfig.Fields.Update
objEmail.Send
Set objEmail = Nothing
Set objConfig = Nothing
End Sub
Bookmarks