charmer
04-10-2006, 06:41 AM
Hi
i am trying to save an attachment for temproray use and then delete it afterwards and i keep getting premission denied error when i want to delete the attachment :/
For Each eItem In Inbox.Items
If eItem.UnRead = True Then
For Each atmt In eItem.Attachments
If Right(atmt.FileName, 3) = "xml" Then
atmtP = "C:\" & atmt.FileName
atmt.SaveAsFile atmtP
'NOW WHEN I TRY TO DO THIS FOR EXAMPLE
kill atmtP ' i get premision denied error
i think once i use SaveAsFile the file is opened and i can't seem to find a way to close it because i can't seem to be able to delete the file even manually unless i close outlook
any help would be great thanks...
Post edited 12-Apr-06 by GeekGirlau. Reason: insert vba tags
i am trying to save an attachment for temproray use and then delete it afterwards and i keep getting premission denied error when i want to delete the attachment :/
For Each eItem In Inbox.Items
If eItem.UnRead = True Then
For Each atmt In eItem.Attachments
If Right(atmt.FileName, 3) = "xml" Then
atmtP = "C:\" & atmt.FileName
atmt.SaveAsFile atmtP
'NOW WHEN I TRY TO DO THIS FOR EXAMPLE
kill atmtP ' i get premision denied error
i think once i use SaveAsFile the file is opened and i can't seem to find a way to close it because i can't seem to be able to delete the file even manually unless i close outlook
any help would be great thanks...
Post edited 12-Apr-06 by GeekGirlau. Reason: insert vba tags