Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDO.AddAttachment won't work

520 views
Skip to first unread message

Stacy Len

unread,
Feb 19, 2003, 4:59:16 PM2/19/03
to
Can someone more experience than I help me here. The below code works fine
with VB or VBS. However, the objEmail.AddAttachment statement isn't
working. Below, you will see that it is commented out. If I uncomment and
try to run it, I get an error at this attachment statement that says,
"Run-time error 438, Object doesn't support this property or method".

But from what I read, the CDO message object should support the .AddAachment
property. I have tried various different filename conventions for the
actual file name attachment, all to no avail.

Thanks
Stacy Whetzell

Private Sub Command1_Click()
Set objemail = CreateObject("CDO.Message")
objemail.From = som...@xyz.com
objemail.To = someo...@xyz.com
objemail.Subject = "test!!!"
'objEmail.AddAttachment = "c:\serid.txt"
objemail.textbody = "Hello World "
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"topaz.cha.tva.gov"
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objemail.Configuration.Fields.Update
objemail.Send
end

Paul Cole

unread,
Mar 5, 2003, 5:28:27 AM3/5/03
to
AddAttachment is a method, not a property, try taking out the = and see if that works, so the line
reads...

objEmail.AddAttachment "c:\serid.txt"

I've done this in an Exchange 2000 SMTP transport event sink and it worked for me, I cannot
guarantee it is applicable to your environment but at a glance I see no reason why it wouldn't work.

0 new messages