Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2019, 11:33 PM
Outlookmess Outlookmess is offline Daily incoming email count report Windows XP Daily incoming email count report Office 2010
Novice
Daily incoming email count report
 
Join Date: Mar 2019
Posts: 2
Outlookmess is on a distinguished road
Default Daily incoming email count report

Is it possible to get a report of incoming emails, number of emails per day, number of emails per month for a certain per etc?



Basically I am getting too many emails per day/month and want to analyse where the emails are coming from so to put in control measures.
Reply With Quote
  #2  
Old 03-30-2019, 02:30 AM
gmayor's Avatar
gmayor gmayor is offline Daily incoming email count report Windows 10 Daily incoming email count report Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could use a script to log the time the messages arrive and who they are from using a two column Excel worksheet with a header row and the following code run from a rule that acts on all incoming messages. I have included a macro to test it with a selected message. You will need to create your own worksheet and change the workbook name as appropriate.


Code:
Option Explicit
Const strWorkBook As String = "C:\Path\EMailLog.xlsx"    '- two column worksheet (Sheet1) with header row

Sub TestCode()
Dim olMsg As MailItem
    On Error Resume Next
    Set olMsg = ActiveExplorer.Selection.Item(1)
    LogEMails olMsg
lbl_Exit:
    Exit Sub
End Sub

Sub LogEMails(olItem As MailItem)
Dim strAddress As String
Dim strDate As String
    strDate = olItem.ReceivedTime
    strAddress = olItem.SenderEmailAddress
    LogToExcel strWorkBook, strAddress, strDate
lbl_Exit:
    Exit Sub
End Sub

Private Function LogToExcel(strWorkBook As String, _
                            strAddress As String, _
                            strDate As String)


Dim ConnectionString As String
Dim strSQL As String
Dim CN As Object
    ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                       "Data Source=" & strWorkBook & ";" & _
                       "Extended Properties=""Excel 12.0 Xml;HDR=YES;"";"
    strSQL = "INSERT INTO [Sheet1$] VALUES('" & strDate & "', '" & strAddress & "')"
    Set CN = CreateObject("ADODB.Connection")
    Call CN.Open(ConnectionString)
    Call CN.Execute(strSQL, , 1 Or 128)
    CN.Close
    Set CN = Nothing
lbl_Exit:
    Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count unique names appeared on specific date for daily report? specky_ Excel 5 02-19-2019 02:26 AM
Automated Send of Email Message Daily meppwc Outlook 1 08-17-2015 06:08 AM
Creating Daily report forms DaveServo Excel 4 05-20-2011 03:38 AM
I'd like to email my daily agenda to me and my assistant automatically aarons Outlook 0 05-05-2011 06:15 AM
Daily incoming email count report Outlook 03: automatic categorize incoming email Alex Rogo Outlook 3 02-10-2009 11:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft