Jamie:
Apparently the Add method has difficulty resolving the reference to the
listbox (I am assuming "FileAttach" is the name of your listbox). There are
a couple of ways to handle this. One is to use the CStr function to resolve
the listbox reference. For example:
If Not IsMissing(Forms!frmMailShot!FileAttach) Then
Set objOutlookAttach =
..Attachments.Add(CStr(Forms!frmMailShot!FileAttach))
End If
Two, you could call the SendMessage routine with the name of the listbox and
use the AttachmentPath parameter of the function as in the KB article. For
example:
SendMessage (Forms!frmMailShot!FileAttach)
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
The code i am using to attach the email is from the 3rd link you posted and
is below,
'Add the attachment to the e-mail message.
If Not IsMissing(Forms!frmMailshot!FileAttach) Then
Set objOutlookAttach = .Attachments.Add(Forms!frmMailshot!FileAttach)
End If
The properties of the listbox are:
RowSource Type = ValueList
Row Source= BLANK
Bound Column= 1
Column Count= 1
Thanks
Jamie