anonymous No title
No License VBA
2021年03月30日
Copy Clone
Sub a()
    Dim oT As Outlook.Table
    Dim strFilter As String
    Dim oRow As Outlook.Row
    Dim oItem As Outlook.MailItem

    On Error Resume Next

    strFilter = ""
    Set oT = Application.Session.GetDefaultFolder(olFolderInbox).GetTable(strFilter)
    Do Until oT.EndOfTable
      Set oRow = oT.GetNextRow
      Set oItem = Application.Session.GetItemFromID(oRow("EntryID"))
      Debug.Print oRow("Subject"); "Attachments.Count=" & oItem.Attachments.Count
      Dim at As Attachment
      For Each at In oItem.Attachments
        Debug.Print at
        If InStr(at, ".") > 0 Then
          at.SaveAsFile ("D:\ss\" & at.FileName)
        End If
      Next
    Loop
End Sub
Sub a()
    Dim oT As Outlook.Table
    Dim strFilter As String
    Dim oRow As Outlook.Row
    Dim oItem As Outlook.MailItem

    On Error Resume Next

    strFilter = ""
    Set oT = Application.Session.GetDefaultFolder(olFolderInbox).GetTable(strFilter)
    Do Until oT.EndOfTable
      Set oRow = oT.GetNextRow
      Set oItem = Application.Session.GetItemFromID(oRow("EntryID"))
      Debug.Print oRow("Subject"); "Attachments.Count=" & oItem.Attachments.Count
      Dim at As Attachment
      For Each at In oItem.Attachments
        Debug.Print at
        If InStr(at, ".") > 0 Then
          at.SaveAsFile ("D:\ss\" & at.FileName)
        End If
      Next
    Loop
End Sub
No one still commented. Please first comment.