#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 |
|
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 |
Outlook 03: automatic categorize incoming email | Alex Rogo | Outlook | 3 | 02-10-2009 11:27 PM |