Get outlook mail messages filter

email
outlook

#1

Hi,

I have searched the forums for many threads like this, but is unable to get what i need working.

I need to filter emails based on the time after ticket submission and the subject title.

I have a datetime variable(DT_ticket) saved when submitting a ticket.
The subject contains “Ticket number:”

The following filter is not working:
“[ReceivedTime] > '”+DT_Ticket.ToString(“MM/dd/yyyy hh:mm tt”)+"’" +“AND [Subject] LIKE ‘ticket number:%’”

What should be the right syntax?

Thank you.


#2

anyone? :frowning:


#3

Hi @tzj,

I tried for similar scenario a month back. It didn’t work for me too.
I think we can have only one filter option at one instance. Can anyone please correct me if I’m wrong.

Alternatively, you can give first option in the filter and once mailMessages are retrieved , take a for each loop and check with if condition whether a particular mail message item has " [Subject] LIKE ‘ticket number:%’” " or not and so on.

If this is not working , let’s wait for others to respond here.

Regards,
SP