Results 1 to 20 of 22

Thread: Outlook - count number of emails in Sent Items folder and spit out results in Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    snb
    Guest
    Avoid clumsy coding:
    Don't bother with 'protection' in Excel.
    To retrieve yesterday's outmails to external addresses:

    Sub M_uit()
        For Each it In Createobject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(5).Items.Restrict("[Senton]>'" & Date - 1 & "' and [Senton]<'" & Date & "'")
           If Right(it.Recipients(1).Address, 10) <> "@mycompany" Then y = y + 1
        Next
       sheet1.cells(Rows.Count, 1).End(xlup).offset(1).resize(, 2) = Array(Date - 1, y)
    End Sub
    Have a look also here: http://www.snb-vba.eu/VBA_Outlook_external_en.html#L_5
    Last edited by Aussiebear; 02-17-2025 at 11:08 PM.

Posting Permissions

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