T
Tom Joseph
I would appreciate some help with this code.
Thanks.
I am geting: run time error 438
Object doesn't support this property or method
at this point: Set oItem = Application.CreateItem(0) 'Create a new message
Dim OutApp As Object
Dim SafeItem, oItem
Dim pdfjob As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an
instance of Redemption.SafeMailItem
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
'On Error Resume Next
With SafeItem
..To = emails
..CC = ""
..BCC = ""
..Subject = Worksheets("eMail").Range("C117").Value & _
Format(Sheets("Main").Range("AB5").Value, "mm/dd/yy") & _
", " & Format(Sheets("Main").Range("AB6").Value) & _
" - " & Worksheets("eMail").Cells(4, i).Value
..Body = Worksheets("eMail").Range("C121").Value & vbCrLf & _
Worksheets("eMail").Range("C122").Value & vbCrLf & _
Worksheets("eMail").Range("C123").Value & vbCrLf & _
Worksheets("eMail").Range("C124").Value & vbCrLf & _
Worksheets("eMail").Range("C125").Value & vbCrLf & _
Worksheets("eMail").Range("C126").Value & vbCrLf & _
Worksheets("eMail").Range("C127").Value & vbCrLf & _
Worksheets("eMail").Range("C128").Value & vbCrLf & _
Worksheets("eMail").Range("C129").Value & vbCrLf & _
Worksheets("eMail").Range("C130").Value & vbCrLf & _
vbCrLf & _
Worksheets("eMail").Range("C134").Value & _
Worksheets("eMail").Range("C135").Value & _
Worksheets("eMail").Range("C136").Value & _
Worksheets("eMail").Range("C137").Value & _
Worksheets("eMail").Range("C138").Value & _
Worksheets("eMail").Range("C139").Value
..Attachments.Add PathFilenameStr
..Send 'or use .Display
End With
'On Error GoTo 0
Application.Wait Now + TimeSerial(0, 0,
Worksheets("Ref").Range("C10").Value)
'Delete the pdf you send
Kill FilenameStr
Set oItem = Nothing
Set SafeItem = Nothing
Set OutApp = Nothing
Thanks.
I am geting: run time error 438
Object doesn't support this property or method
at this point: Set oItem = Application.CreateItem(0) 'Create a new message
Dim OutApp As Object
Dim SafeItem, oItem
Dim pdfjob As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an
instance of Redemption.SafeMailItem
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
'On Error Resume Next
With SafeItem
..To = emails
..CC = ""
..BCC = ""
..Subject = Worksheets("eMail").Range("C117").Value & _
Format(Sheets("Main").Range("AB5").Value, "mm/dd/yy") & _
", " & Format(Sheets("Main").Range("AB6").Value) & _
" - " & Worksheets("eMail").Cells(4, i).Value
..Body = Worksheets("eMail").Range("C121").Value & vbCrLf & _
Worksheets("eMail").Range("C122").Value & vbCrLf & _
Worksheets("eMail").Range("C123").Value & vbCrLf & _
Worksheets("eMail").Range("C124").Value & vbCrLf & _
Worksheets("eMail").Range("C125").Value & vbCrLf & _
Worksheets("eMail").Range("C126").Value & vbCrLf & _
Worksheets("eMail").Range("C127").Value & vbCrLf & _
Worksheets("eMail").Range("C128").Value & vbCrLf & _
Worksheets("eMail").Range("C129").Value & vbCrLf & _
Worksheets("eMail").Range("C130").Value & vbCrLf & _
vbCrLf & _
Worksheets("eMail").Range("C134").Value & _
Worksheets("eMail").Range("C135").Value & _
Worksheets("eMail").Range("C136").Value & _
Worksheets("eMail").Range("C137").Value & _
Worksheets("eMail").Range("C138").Value & _
Worksheets("eMail").Range("C139").Value
..Attachments.Add PathFilenameStr
..Send 'or use .Display
End With
'On Error GoTo 0
Application.Wait Now + TimeSerial(0, 0,
Worksheets("Ref").Range("C10").Value)
'Delete the pdf you send
Kill FilenameStr
Set oItem = Nothing
Set SafeItem = Nothing
Set OutApp = Nothing