E_DPSG
Board Regular
- Joined
- Jul 17, 2008
- Messages
- 82
Ok - So, I posted about an error I was receiving related to the Outlook call a while back. I went around that completely and am just going to use SMTP to send an email directly (very similar to vbs, with obvious modifications for excel execution).
I am getting a type mismatch error when assigning the attachment with the following syntax:
When setting the attachment, I get a Run-TIme Error: '13' Type Mismatch.
When I use the alternate:
objCDOMsg.AddAttachment = AttachmentFile
I do not receive this error, yet I need to attach multiple documents during the call.
Did I miss something here that is so obvious that I am blind to the issue?
Thanks!
I am getting a type mismatch error when assigning the attachment with the following syntax:
Code:
Dim AttachmentFile As String
....
Set objCDOMsg = CreateObject("cdo.message")
Set objCDOCfg = CreateObject("cdo.configuration")
Set objFields = objCDOCfg.Fields
objFields.Item("[url=http://schemas.microsoft.com/cdo/configuration/sendusing]Error[/url]") = 2
objFields.Item("[url=http://schemas.microsoft.com/cdo/configuration/smtpserver]Error[/url]") = "MyMail.Server.com"
objFields.Update
Set objCDOMsg.Configuration = objCDOCfg
....
AttachmentFile = Sheets("Email_Distribution").Range("H" & i).Value
objCDOMsg.Attachments.Add (AttachmentFile)
When setting the attachment, I get a Run-TIme Error: '13' Type Mismatch.
When I use the alternate:
objCDOMsg.AddAttachment = AttachmentFile
I do not receive this error, yet I need to attach multiple documents during the call.
Did I miss something here that is so obvious that I am blind to the issue?
Thanks!