Error 2455 “Invalid reference to property filesearchâ€

M

Masoud

I have the code like below for sending email with attachments, but I found
error 2455 “you entered an expression that has an invalid reference to the
property filesearch.
' Add attachments to the message.
With Application.FileSearch
.LookIn = Forms!frmMail!Att
.FileName = "*.*"
.Execute

For i = 1 To .FoundFiles.Count
objOutlookMsg.Attachments.Add .FoundFiles(i)
Next i
End With

please help.
 
J

Jack Leach

If you are using Access 2007, apparently the FileSearch functionality has
been removed. You will need an alternate method to locate what you need.
Aside from that, I'm not very familiar with the method to begin with so I'm
not sure.

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Top