How to find subject outlook b string + next month 2020

how to find subject outlook by string + next month 2020
Example : find subject start with report and according with next month and year from today.

1 Like

you can create a variable and assign a month search key text and input in between %%

“@SQL=”“http://schemas.microsoft.com/mapi/proptag/0x0037001f”" like ‘%SearchMonthString%’"

I don’t know how to find subject by string + next month

image

1 Like

@fairymemay Can you show us How the Subject appears in Mail ?

image

if your search text similar to : reportMarch
try similar like this.
mail.Subject.Contains(“report”+nextmonth)
@fairymemay

@fairymemay If you have already converted the Date into the Needed format, then i guess you can use this in if Condition :
mailSubject.Contains("Report "+nextMonth)

Awesome if we are ready to filter with If condition then the condition be like this
mail.Subject.Contains(“Report EX for”) AND mail.Subject.Contains(Now.AddMonth(1).ToString(“MMMM yyyy”))

Two conditions with AND operator

Cheers @fairymemay

If you use Get Outlook Mail write this in Filter:

"@SQL=urn:schemas:httpmail:subject LIKE '%Report " + System.DateTime.Now.AddMonths(1).ToString("MM yyyy") + "%'"

System.DateTime.Now.AddMonths(1).ToString("MM yyyy")

gives you next month with year like 03 2020. You can change the formatting.

And if found email subject "report " , create new email by copy message from templete

How to?

To handle this
mail.Subject.ToString.ToUpper.Contains(“REPORT EX FOR”) AND mail.Subject.Contains(Now.AddMonth(1).ToString(“MMMM yyyy”))

and you can use FORWARD property to handle that

Cheers @fairymemay