T
Tony Vrolyk
I am wondering what I am doing wrong here. The following code is giving me
an error. I can post more of it if need be.
The message is created, the recipients are set, the subject and body is set
ok, then it appear to stop. When I go back to the Access window it shows me
the runtime 2351 error "Operation is not supported for this type of object".
When I click Debug it has stopped at the .Attachments line
Maybe I am overlooking something simple but then again I was up for 4 hours
in the middle of the night last night with my son - so I am not at my best.
Any help would be appreciated.
Tony Vrolyk
'---code start---
With objMessage
.BCC = strBCCReceipient
.Subject = "blah blah blah"
.Body = "more blah blah blah"
.Importance = olImportanceHigh
Set rst = CurrentDb().OpenRecordset("SELECT FilePath, DocumentType FROM
qryRenewalWork_Documents_Include WHERE (RenewalWorkID)=" & Me.RenewalWorkID)
Do Until rst.EOF
.Attachments.Add rst!FilePath, olByValue, rst!DocumentType
Loop
rst.Close
Set rst = Nothing
.Display
End With
'---code end---
an error. I can post more of it if need be.
The message is created, the recipients are set, the subject and body is set
ok, then it appear to stop. When I go back to the Access window it shows me
the runtime 2351 error "Operation is not supported for this type of object".
When I click Debug it has stopped at the .Attachments line
Maybe I am overlooking something simple but then again I was up for 4 hours
in the middle of the night last night with my son - so I am not at my best.
Any help would be appreciated.
Tony Vrolyk
'---code start---
With objMessage
.BCC = strBCCReceipient
.Subject = "blah blah blah"
.Body = "more blah blah blah"
.Importance = olImportanceHigh
Set rst = CurrentDb().OpenRecordset("SELECT FilePath, DocumentType FROM
qryRenewalWork_Documents_Include WHERE (RenewalWorkID)=" & Me.RenewalWorkID)
Do Until rst.EOF
.Attachments.Add rst!FilePath, olByValue, rst!DocumentType
Loop
rst.Close
Set rst = Nothing
.Display
End With
'---code end---