Re: Attachment Using CDO.MESSAGE

"RN1" <rn5a [at] rediffmail.com> wrote in message
news:22c8c699-74bf-4525-8332-a7851d885a8f [at] d27g2000prf.google groups.com...
> On Dec 15, 5:34 pm, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > "RN1" <r... [at] rediffmail.com> wrote in message
> >
> > news:53695732-6bf3-48ad-9045-79d4a0c0b38b [at] t1g2000pra.googleg roups.com...
> >
> > > An ASP page first creates a MS-Word (doc) document using the values
> > > received from a HTML Form & then mails this doc file as an attachment
> > > for which I am using CDO.MESSAGE but the line
> >
> > > cdoMessage.AddAttachment Server.MapPath(strFile)
> >
> > > generates the following error:
> >
> > > The process cannot access the file because it is being used by another
> > > process.
> >
> > > which points to the AddAttachment line (shown above).
> >
> > > How do I overcome this error?
> >
> > You'll have a Word application object still holding the file open. As
the
> > link that Bob has posted in a later thread indicates, this not a good
idea.
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET
>
> Anthony, if I am not mistaken, what Bob has suggested is very much
> different to what I want to do here. What Bob has suggested that is
> for opening a Word file using ASP but here I want to first create the
> Word document (which I have taken care of) & then mail it as an
> attachment. At no point do I want to open that Word document that ASP
> creates.

Please post the code that creates the Word document.

>
> Anyway, how do I ensure that the Word object is not holding the file
> open?


My advice is don't use Office objects in ASP.

--
Anthony Jones - MVP ASP/ASP.NET
Anthony Jones [ Sa, 22 Dezember 2007 14:08 ] [ ID #1892616 ]
Webserver » microsoft.public.inetserver.asp.general » Re: Attachment Using CDO.MESSAGE

Vorheriges Thema: Error Type: Server object, ASP 0177 (0x800AEA5F) 800aea5f
Nächstes Thema: Re: writing out XML with ASP