I am working on a small script that reads an email and based on the first letter of an attachment name it routes the email to user A or User B.
Some of the emails contain multiple attachments, but all of the attachments start with the same letter. I only need to take action on the email after reading the first attachment, but all the code I’ve found analyzes all of the attachments.
How do I take action based on the first file analyzed? Is there a better way for me to be doing this?
Thanks in advance. Below is a section of the code:
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
If Left$(o.Name,1)=“W” Or Left$(o.Name,1)=“D” Then
…Send message to user A
If Left$(o.Name,1)=“N” Or Left$(o.Name,1)=“E” Then
…Send message to user B***