CDONTS Attachments and VBA

This one if killin me. If I take out the Attachment line the it runs just fine

This is the error msg I get :
Run-time error ‘-2147467259 (80004005)’ : Method ‘AttachFile’ of object ‘INewMail’ failed

Here is what I have so far :

Sub Main()

Dim scheduledirectory As String
Dim objNewMail

scheduledirectory = “E:\schedule”

Set objNewMail = CreateObject(“CDONTS.NewMail”)

objNewMail.From = “BusinessObjects@powerquest.com” objNewMail.Body = “International Overview has been refreshed” objNewMail.Subject = “International Overview has been refreshed” objNewMail.To = “ian.humphries@powerquest.com” call objNewMail.AttachFile(“E:\schedule\international_overview\international_overview.html”,“sigh.html”) (I’ve also tried it without the call but it fails syntax : Compile Error) objNewMail.Send
Set objNewMail = Nothing

End Sub

HELP! hehe

Ian


Listserv Archives (BOB member since 2002-06-25)