I am trying to add an attachment to e-mails created and customized based on data in an Oracle table. I have an ADODB connection object that grabs the data -- no problems there.
The issue is that when I try to add attachments to my mail item object, I get an error -- Run time error 438, object doesn't support this property or method -- on the add attachments statement.
Any suggestions?
Set outlook_app = CreateObject("Outlook.Application")
While Not medical_schools.EOF
' Filter the check data to get the row of the current institution
check_data.Filter = "inst_id=" & institutions!inst_id
check_data.MoveFirst
' Create the message.
Set outlook_msg = outlook_app.CreateItem(olMailItem)
With outlook_msg
' Add the To recipient(s) to the message.
Set outlook_recip = .Recipients.Add(check_data!email_addr)
outlook_recip.Type = olTo
' Set the Subject and Importance of the message.
.Subject = "Data Verification - " & check_data!inst_name
.Attachments.Add check_data!attach_path
End With
' Build the message body then send
Thank you for your help.
The issue is that when I try to add attachments to my mail item object, I get an error -- Run time error 438, object doesn't support this property or method -- on the add attachments statement.
Any suggestions?
Set outlook_app = CreateObject("Outlook.Application")
While Not medical_schools.EOF
' Filter the check data to get the row of the current institution
check_data.Filter = "inst_id=" & institutions!inst_id
check_data.MoveFirst
' Create the message.
Set outlook_msg = outlook_app.CreateItem(olMailItem)
With outlook_msg
' Add the To recipient(s) to the message.
Set outlook_recip = .Recipients.Add(check_data!email_addr)
outlook_recip.Type = olTo
' Set the Subject and Importance of the message.
.Subject = "Data Verification - " & check_data!inst_name
.Attachments.Add check_data!attach_path
End With
' Build the message body then send
Thank you for your help.