Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2001
    Location
    Stuck at work..., Missouri, USA
    Posts
    248
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete Messages (2003)

    I have a process that needs to save attachments from all e-mails in the in box and then delete the messages.

    I found code to save the attachments, but now I need to know how to delete the messages.

    Any pointers?

    Thanks!
    <font face="Comic Sans MS">Morgan Erickson</font face=comic>
    morgan.erickson@sprint.com
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18>-From <img src=/S/flags/Colorado.gif border=0 alt=Colorado width=30 height=18> but living in <img src=/S/flags/Missouri.gif border=0 alt=Missouri width=30 height=18>...and working in Kansas.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete Messages (2003)

    The MailItem object has a Delete method. If you want to delete items in a loop, you should loop backwards:

    Dim i As Integer
    For i = objFolder.Items.Count To 1 Step -1
    ' do something with objFolder.Items(i)
    ...
    ' then delete it:
    objFolder.Items(i).Delete
    Next i

    where objFolder is a variable of type MAPIFolder.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Delete Messages (2003)

    If you want to delete the messages permantly without any possible recovery, see also the CDO code in the sub in <post:=706,948>post 706,948</post:>.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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