Hi there
I have the below code which I know is incorrect for the To. but I don't know how to fix? would appreciate any help. I have the list on another sheet. It's in a table if that helps: Table16
[CODE]
Sub emailsavePDF_weekly()
Dim objOutlook As Object
Dim objMail As Object
Dim signature As String
Dim oWB As Workbook
Set oWB = ActiveWorkbook
Dim PDF_File As String
s = Range("b1").Value
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
s, Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
PDF_File = Range("b1").Value
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.display
End With
signature = objMail.body
With objMail
[COLOR=#ff0000] .To = Sheets("DataLists_Lkup") & Range("F2:F20").Value[/COLOR]
.Cc = "test@test.co.uk"
.Subject = "Weekly League Tables for Banked vs Written " & Range("e2").Value
' .body = "Hi " & Range("B2").Value & "," _
& vbNewLine & vbNewLine & _
"Please find attached your monthly commission statement for " & Range("I3").Value _
& vbNewLine & vbNewLine _
& "Any questions please do not hesitate to ask." _
& vbNewLine & vbNewLine _
& "Kind Regards, Lindsay" _
& vbNewLine _
& signature
.body = "Hi " & Range("B2").Value & "," _
& vbNewLine & vbNewLine & _
"Please find attached this weeks' league tables." _
& vbNewLine & vbNewLine _
& "Any questions please do not hesitate to ask." _
& vbNewLine & vbNewLine _
& "Kind Regards," _
& vbNewLine _
& "Lindsay" _
& vbNewLine _
& signature
.Attachments.Add PDF_File
.Save
.display
End With
'_
Set objOutlook = Nothing
Set objMail = Nothing
End Sub
'HTMLbody = "****** style=font-size:11pt;font-family:Calibri>
[/CODE]
Many thanks
Melissa
I have the below code which I know is incorrect for the To. but I don't know how to fix? would appreciate any help. I have the list on another sheet. It's in a table if that helps: Table16
[CODE]
Sub emailsavePDF_weekly()
Dim objOutlook As Object
Dim objMail As Object
Dim signature As String
Dim oWB As Workbook
Set oWB = ActiveWorkbook
Dim PDF_File As String
s = Range("b1").Value
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
s, Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
PDF_File = Range("b1").Value
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.display
End With
signature = objMail.body
With objMail
[COLOR=#ff0000] .To = Sheets("DataLists_Lkup") & Range("F2:F20").Value[/COLOR]
.Cc = "test@test.co.uk"
.Subject = "Weekly League Tables for Banked vs Written " & Range("e2").Value
' .body = "Hi " & Range("B2").Value & "," _
& vbNewLine & vbNewLine & _
"Please find attached your monthly commission statement for " & Range("I3").Value _
& vbNewLine & vbNewLine _
& "Any questions please do not hesitate to ask." _
& vbNewLine & vbNewLine _
& "Kind Regards, Lindsay" _
& vbNewLine _
& signature
.body = "Hi " & Range("B2").Value & "," _
& vbNewLine & vbNewLine & _
"Please find attached this weeks' league tables." _
& vbNewLine & vbNewLine _
& "Any questions please do not hesitate to ask." _
& vbNewLine & vbNewLine _
& "Kind Regards," _
& vbNewLine _
& "Lindsay" _
& vbNewLine _
& signature
.Attachments.Add PDF_File
.Save
.display
End With
'_
Set objOutlook = Nothing
Set objMail = Nothing
End Sub
'HTMLbody = "****** style=font-size:11pt;font-family:Calibri>
[/CODE]
Many thanks
Melissa