Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Getting Attachments from outlook folder

    I have a folder for certian work ( Amex charges ) that i have to do.
    its name is UnallocAmex

    Each email in the file has an attachment. I would like to automate the process of copying the attachments to a dir C:\Unalloc\

    From there i create data tables (.net) and update date in my database (sql Server)

    I CANT FIGURE IT OUT!!!!!!!!!!!!!

    Any help greatly appreciated

  2. #2
    Join Date
    Oct 2003
    for anyones info:

    the restriction isnt one at all it is to & my name

    Dim i, j As Integer
    Dim oApp As Outlook.Application = New Outlook.Application
    Dim sClassComp = "IPM.Note" ' String used for comparison with mail item.
    Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI") 'Get mapi namespace
    Dim file As System.IO.FileInfo
    Dim s As String = "_Unallocated Amex"
    ' Get Messages collection of Inbox.
    Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderInbox)
    Dim oItems As Outlook.Items = oInbox.Folders.Item(s).Items
    Dim oAttachment As Outlook.Attachment
    Dim oMsg As Outlook.MailItem

    oItems = oItems.Restrict("[to]= Michael Kerr")
    ' Loop each message.
    For i = 1 To oItems.Count
    'Test to make sure item is a mail item
    'and not a meeting request.
    If oItems.Item(i).MessageClass = sClassComp Then
    oMsg = oItems.Item(i)
    For j = 1 To oMsg.Attachments.Count
    oAttachment = oMsg.Attachments.Item(i)
    End If
    ' Clean up.
    oApp = Nothing
    oNS = Nothing
    oItems = Nothing
    oMsg = Nothing

Posting Permissions

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