Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Colorado, USA
    Thanked 0 Times in 0 Posts

    Saving Attachments in a Macro (Outlook 2000)

    I've been working on a macro that saves objects contained in an outlook session to text files for transfer to Linux Kmail (please don't shoot me for this <img src=/S/duck.gif border=0 alt=duck width=23 height=23> ). As the script steps through the items in the folder collection, I am able to tell if an email contains attachments, but I haven't found a way to programatically save the attachment to another folder. Is there a way to do this That I'm missing? Right now, I set a generic object equal to the return of the GetNext() method of the Items collection. I can use the object.Attachments.Count property to tell if there are attachments, but there doesn't seem to be a SaveAs method for the Attachments collection like there is for all the item types.

    Thanks for the help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Saving Attachments in a Macro (Outlook 2000)

    The Attachment object has a SaveAsFile method:

    Dim i As Long
    For i = 1 To objMailItem.Attachments.Count
    objMailItem.Attachments.Item(i).SaveAsFile "C:MyFolder'" & objMailItem.Attachments.Item(i).DisplayName
    Next i

Posting Permissions

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