Consulting

Results 1 to 3 of 3

Thread: Solved: Kill permision denied

  1. #1

    Talking Solved: Kill permision denied

    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 :/

    [vba]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 [/vba]


    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

  2. #2
    problem solved!,

    I found out that when i get the attachment file i keep a reference to it, so when i tried to delete it i couldn't do that >_>. thx all anywayz

  3. #3
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Hi Charmer,

    I'm glad you were able to solve this so quickly!

    Just for future reference, please use the vba tags when posting code as it makes it easier to read - select the code, then click on the VBA button.

    I've marked this thread as "Solved" for you - normally you can do this yourself via the Thread Tools option at the top of the page, however it's not working at the moment. If you want to mark a thread as solved, post a message to that effect and one of the Moderators will do it for you.

    And welcome to the board

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •