Attaching a word doc in asp email code
Posted on 2004-04-30
I am puzzled experts.
My asp code is dumping the contents of a db file into a word doc and
then creates a file on the web root directory per code below.
Problems I am running are:
1, If I created a field name called filename on the db specifically to be the name of doc file being create.
I then hardcoded the value for this field.
The whole idea is when this file is created on a folder, it will have that name like notify.doc
When I run this one line of code below, I get the error permission denied.
file_being_created= rs("filename") & ".doc"
Microsoft VBScript runtime (0x800A0046)
I don't know why because code below should overwrite a doc file if it already exists.
Set act = fso.CreateTextFile(server.mappath(file_being_created), true)
The other error occurs when I change file_being_created to autonumber on the db.
If I change the file_being_cr
file_being_created= rs("ID") & ".doc"
The system cannot find the file specified.
Set .Configuration = iConf
.From = "web Admin <domain.com>"
.To = "domain.com"
.Sender = "web Admin <domain.com>"
.Subject = "New Information"
.TextBody = "Attached is a word document added to the database. "
Any help would be appreciated.