I have a macro that automatically files emails according to their subject. However, if the folder it searches to save in does not exist it flags the message - green for missing job, orange for missing email folder, i.e. jobs\1234\email is the path for the message to be saved in. If email is missing, orange flag; if 1234, green flag.
The problem is that people put multiple job numbers in the subject, so one job might be missing the number, the other missing the email folder. I need the macro to detect if the message has already been flagged during this scan.
This macro is run multiple times a day, so it can't change something that was flagged in a previous run. Here is my code so far.
The problem is that people put multiple job numbers in the subject, so one job might be missing the number, the other missing the email folder. I need the macro to detect if the message has already been flagged during this scan.
This macro is run multiple times a day, so it can't change something that was flagged in a previous run. Here is my code so far.
Code:
If DirExists(sjob) Then
If DirExists(semail) Then
|
|
save routine
|
|
Else
item.FlagStatus = 2 'olFlagMarked
item.FlagIcon = 2 'olOrangeFlagIcon
item.Save
End If
Else
item.FlagStatus = 2 'olFlagMarked
item.FlagIcon = 3 'olGreenFlagIcon
item.Save
End If