Detect unread emails but avoid reprocessing them

Like How do i detect unread emails but avoid reprocessing them after extracting PDF data??( give me exact code)
Thanks !!!

Hi @Aarya_singh

You can use this approach To process email

  1. Read already-processed message IDs from a text file

  2. Get unread emails from Outlook

  3. Check if message ID is already processed

  4. If not

    • Process PDF

    • Save/Move file

    • Add message ID to the processed file

    • Mark email as read

  5. Next run → bot skips old ones

@Aarya_singh

there is no specific code needed

get email activity has two properties

  1. Read only unread emails
  2. Mark item as read

first will get only new items

second property will mark the item as read once it is read

cheers

If processedList.Contains(mail.Headers(“Message-Id”))Then
Countinue For
End If

Store the message-id

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.