Eljefegeneo
Still trying to learn
- Local time
- Today, 02:56
- Joined
- Jan 10, 2011
- Messages
- 902
I use the fairly standard method of sending out an email blast with a provision for adding an attachment using
Attch is a string.
Works fine if there is an attachment. But if there is no attachment by user selection, I get an error message that
Runtime error '-2147024809 (80070057)' Could not complete the operation. One or more parameters are not valid.
It is obvious to me that the code is looking for an attachment.
I tried the following but it did not solve the problem.
I amended my code so that the user can select whether or not they want an attachment. But what I would like to know is how to amend the code to not include an attachment without having a second set of codes without the .Attachments.add(Attch) line.
I hope I am making sense. Just trying to simplify the code.
[FONT="]Thanks[/FONT]
Code:
.Attachments.Add (Attch)
Works fine if there is an attachment. But if there is no attachment by user selection, I get an error message that
Runtime error '-2147024809 (80070057)' Could not complete the operation. One or more parameters are not valid.
It is obvious to me that the code is looking for an attachment.
I tried the following but it did not solve the problem.
Code:
If Not IsNull(txtAttachment) Then
Attch = Me.txtAttachment
Else: Attch = ""
End If
I hope I am making sense. Just trying to simplify the code.
[FONT="]Thanks[/FONT]