By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

Create/mail/delete - files

P: n/a
Can anyone help me??

Im having trouble to delete and then create files, that i've emailed??.

1)
Im sending a file using cdo.message class

Dim CDOMsg = New CDO.Message

With CDOMsg
.To = "me@my.com"
.From = "me@my.com"
.Subject = "FileTest"
.HTMLBody = "<html>See attached file.</html>"
.AddAttachment("C:\test.txt")
.Send()
End With

2)
Deleting the file
If File.Exists(C:\test.txt) Then
File.Delete(C:\test.txt)
End If

3)
Then i tried to create a new file, with the same name. But i get a
permission denied??
I have found out that it's probely is the cdo.message, who still got a
refferance to the file, but how do i remove this refferance to the cdo??

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
CDOMsg = nothing
"Henrik" <He****@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
Can anyone help me??

Im having trouble to delete and then create files, that i've emailed??.

1)
Im sending a file using cdo.message class

Dim CDOMsg = New CDO.Message

With CDOMsg
.To = "me@my.com"
.From = "me@my.com"
.Subject = "FileTest"
.HTMLBody = "<html>See attached file.</html>"
.AddAttachment("C:\test.txt")
.Send()
End With

2)
Deleting the file
If File.Exists(C:\test.txt) Then
File.Delete(C:\test.txt)
End If

3)
Then i tried to create a new file, with the same name. But i get a
permission denied??
I have found out that it's probely is the cdo.message, who still got a
refferance to the file, but how do i remove this refferance to the cdo??

Thanks

Nov 21 '05 #2

P: n/a
Hi Rick,,

Sorry,, but of couse im setting my cdomsg to nothing, but it still does't
work?

Do you know if i can attach a stream insted?? then i can flush it instead..

"Rick Mogstad" wrote:
CDOMsg = nothing
"Henrik" <He****@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
Can anyone help me??

Im having trouble to delete and then create files, that i've emailed??.

1)
Im sending a file using cdo.message class

Dim CDOMsg = New CDO.Message

With CDOMsg
.To = "me@my.com"
.From = "me@my.com"
.Subject = "FileTest"
.HTMLBody = "<html>See attached file.</html>"
.AddAttachment("C:\test.txt")
.Send()
End With

2)
Deleting the file
If File.Exists(C:\test.txt) Then
File.Delete(C:\test.txt)
End If

3)
Then i tried to create a new file, with the same name. But i get a
permission denied??
I have found out that it's probely is the cdo.message, who still got a
refferance to the file, but how do i remove this refferance to the cdo??

Thanks


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.