![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have an Outlook rule that check for incoming mail, when the mail is from
dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". Now I want it to further call a Macro to process deletion if necessary before moving to the "Audit Log Cleared" folder. I have a list of servers that have scheduled job to do audit log clearing at specified time and day of a week, the sample of the list: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The list is very long, so tedious to just put these into the rule itself, further the Outlook rule limitation on rule storage size will be reached. Therefore I would to have a Macro that do the checking: 1. Look in the subject and look for string that matches any of the server 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit. |
Ads |
#2
|
|||
|
|||
![]() What is your question? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Thu, 23 Jul 2009 20:24:01 -0700 schrieb Sing Chung: I have an Outlook rule that check for incoming mail, when the mail is from dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". Now I want it to further call a Macro to process deletion if necessary before moving to the "Audit Log Cleared" folder. I have a list of servers that have scheduled job to do audit log clearing at specified time and day of a week, the sample of the list: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The list is very long, so tedious to just put these into the rule itself, further the Outlook rule limitation on rule storage size will be reached. Therefore I would to have a Macro that do the checking: 1. Look in the subject and look for string that matches any of the server 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit. |
#3
|
|||
|
|||
![]()
The question is:
How do I write a Macro to: 1. Look in the subject of incoming e-mails (which are already moved to the "Audit Log Cleared" folder) and look for string that matches any of the servers in the list (sample shown below) 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit? Background information: I have an Outlook rule that check for incoming mail, when the mail is from dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". The sample list of servers look like this: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The dates and times here refer to the times when these particular servers are scheduled to do audit log clearing. The idea is if the 'audit log is cleared' alerts sent by DCMonitor belongs to the groups of servers that are scheduled to do audit log clearing, then ignore these alerts (delete them), then only the genuine alerts (those unexpected ones) I need to take care. The name of the server is included in the subject of the alert e-mails. "Michael Bauer [MVP - Outlook]" wrote in message ... What is your question? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Thu, 23 Jul 2009 20:24:01 -0700 schrieb Sing Chung: I have an Outlook rule that check for incoming mail, when the mail is from dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". Now I want it to further call a Macro to process deletion if necessary before moving to the "Audit Log Cleared" folder. I have a list of servers that have scheduled job to do audit log clearing at specified time and day of a week, the sample of the list: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The list is very long, so tedious to just put these into the rule itself, further the Outlook rule limitation on rule storage size will be reached. Therefore I would to have a Macro that do the checking: 1. Look in the subject and look for string that matches any of the server 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit. |
#4
|
|||
|
|||
![]() 1. You might start with the ItemAdd event, which fires when an item is added to a folder. The server names can be searched in the Subject property of the email with the Instr function. A question is where you will get the server names and times from. You can use a collection object or an array, and 'hard-code' the data; maybe you want to read the data from a file, which would add some steps. 2. Read the ReceivedTime property, and use the DateDiff function to compare the date with your collection of dates. If there's a match, call the item's Delete method. All mentioned functions are explained, usually with an example, in the VBA help file. -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Wed, 29 Jul 2009 23:44:02 +0800 schrieb Hii Sing Chung: The question is: How do I write a Macro to: 1. Look in the subject of incoming e-mails (which are already moved to the "Audit Log Cleared" folder) and look for string that matches any of the servers in the list (sample shown below) 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit? Background information: I have an Outlook rule that check for incoming mail, when the mail is from dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". The sample list of servers look like this: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The dates and times here refer to the times when these particular servers are scheduled to do audit log clearing. The idea is if the 'audit log is cleared' alerts sent by DCMonitor belongs to the groups of servers that are scheduled to do audit log clearing, then ignore these alerts (delete them), then only the genuine alerts (those unexpected ones) I need to take care. The name of the server is included in the subject of the alert e-mails. "Michael Bauer [MVP - Outlook]" wrote in message ... What is your question? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Thu, 23 Jul 2009 20:24:01 -0700 schrieb Sing Chung: I have an Outlook rule that check for incoming mail, when the mail is from dcmonitor, with subject containing "NT Event Security" and mail body containing the words "audit log is cleared", then move the the outlook folder "Audit Log Cleared". Now I want it to further call a Macro to process deletion if necessary before moving to the "Audit Log Cleared" folder. I have a list of servers that have scheduled job to do audit log clearing at specified time and day of a week, the sample of the list: Day Time Servers Sun 00:01 SS203, SS204, SN404, SN203, SF1203, SL2311 Daily 03:20 SS111, SS320, SN23 Daily 04:21 SN434, SN34 Wed 01:20 SSN2333, SNL2 The list is very long, so tedious to just put these into the rule itself, further the Outlook rule limitation on rule storage size will be reached. Therefore I would to have a Macro that do the checking: 1. Look in the subject and look for string that matches any of the server 2. If the match is found check the date and time of the mail and see if the corresponding day and time (allow time window of 1 hour) in the list matches. 3. If matches, delete the e-mail 4. If no match, exit. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
collapse a specific mail folder from a macro in Outlook 2007 | udo | Outlook and VBA | 6 | February 5th 09 09:26 AM |
collapse a specific mail folder from a macro in Outlook 2007 | udo | Outlook - General Queries | 2 | February 2nd 09 03:08 PM |
Macro to rename Subject of E-mail on exchange server(2007) | Ryan Arnold | Outlook and VBA | 4 | October 6th 08 04:30 AM |
Macro to delete messages with given subject after message expires | Sami[_2_] | Outlook and VBA | 1 | September 9th 08 08:11 AM |
Delete tasks from mail subject | vbadude_sl | Outlook and VBA | 4 | March 1st 07 03:46 PM |