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=”“”" like ‘%SearchMonthString%’"

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


1 Like

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


if your search text similar to : reportMarch
try similar like this.

@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