Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect if item is flagged in Outlook

Status
Not open for further replies.

smurfhell

MIS
Nov 5, 2004
45
US
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.

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
 
Nevermind, I think I've gotten it figured out. I will update this post once I finish rearranging my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top