From: Sharkbyte on
I have setup email, using CDO, in a database. I have incorporated
www.lebans.com's code for creating a PDF.

However, when I configure my CDO.Message object, I get an

"Object doesn't support this property or method. Error Number 438"

Here is the offending code. It is the .AddAttachment property.

With iMsg
.To = gblEmail1
.From = gblEmailFrom
.BCC = gblEmailBCC
.Subject = gblEmailSubject
.Sender = gblEmailReply
.ReplyTo = gblEmailReply
.HTMLBody = gblEmailBody
.AddAttachment = "c:\tsw\" & gblReportName


Can anyone offer a suggestion on the correct property name? I can't track
it down.

Thanks.

Sharkbyte
From: Hans Up on
Sharkbyte wrote:
> I have setup email, using CDO, in a database. I have incorporated
> www.lebans.com's code for creating a PDF.
>
> However, when I configure my CDO.Message object, I get an
>
> "Object doesn't support this property or method. Error Number 438"
>
> Here is the offending code. It is the .AddAttachment property.
>
> With iMsg
> .To = gblEmail1
> .From = gblEmailFrom
> .BCC = gblEmailBCC
> .Subject = gblEmailSubject
> .Sender = gblEmailReply
> .ReplyTo = gblEmailReply
> .HTMLBody = gblEmailBody
> .AddAttachment = "c:\tsw\" & gblReportName

I haven't tried this myself, but it looks to me like AddAttachment is a
method rather than a property. You can't assign a value (as in .method
= value) to property. Try it like this:

..AddAttachment ("c:\tsw\" & gblReportName)
From: Hans Up on
Hans Up wrote:

> I haven't tried this myself, but it looks to me like AddAttachment is a
> method rather than a property. You can't assign a value (as in .method
> = value) to property. Try it like this:
>
> .AddAttachment ("c:\tsw\" & gblReportName)

I meant to say "to a method" instead of "to property".

And I don't if the parentheses would be required. So maybe try it this
way, too:

..AddAttachment (\"c:\tsw\" & gblReportName
From: Dorian on
Why dont you look in the Object Browser. It will list all the properties and
methods for each object.
Click F2 from any code window and select your CDO library.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Sharkbyte" wrote:

> I have setup email, using CDO, in a database. I have incorporated
> www.lebans.com's code for creating a PDF.
>
> However, when I configure my CDO.Message object, I get an
>
> "Object doesn't support this property or method. Error Number 438"
>
> Here is the offending code. It is the .AddAttachment property.
>
> With iMsg
> .To = gblEmail1
> .From = gblEmailFrom
> .BCC = gblEmailBCC
> .Subject = gblEmailSubject
> .Sender = gblEmailReply
> .ReplyTo = gblEmailReply
> .HTMLBody = gblEmailBody
> .AddAttachment = "c:\tsw\" & gblReportName
>
>
> Can anyone offer a suggestion on the correct property name? I can't track
> it down.
>
> Thanks.
>
> Sharkbyte
From: Sharkbyte on
Dorian:

I tried but do not find the Object...



"Dorian" wrote:

> Why dont you look in the Object Browser. It will list all the properties and
> methods for each object.
> Click F2 from any code window and select your CDO library.
> -- Dorian
> "Give someone a fish and they eat for a day; teach someone to fish and they
> eat for a lifetime".
>
>
> "Sharkbyte" wrote:
>
> > I have setup email, using CDO, in a database. I have incorporated
> > www.lebans.com's code for creating a PDF.
> >
> > However, when I configure my CDO.Message object, I get an
> >
> > "Object doesn't support this property or method. Error Number 438"
> >
> > Here is the offending code. It is the .AddAttachment property.
> >
> > With iMsg
> > .To = gblEmail1
> > .From = gblEmailFrom
> > .BCC = gblEmailBCC
> > .Subject = gblEmailSubject
> > .Sender = gblEmailReply
> > .ReplyTo = gblEmailReply
> > .HTMLBody = gblEmailBody
> > .AddAttachment = "c:\tsw\" & gblReportName
> >
> >
> > Can anyone offer a suggestion on the correct property name? I can't track
> > it down.
> >
> > Thanks.
> >
> > Sharkbyte