outlook 2007 - sort incoming email - if sunject = 'x' write to a text file else end program
Posted on 2010-09-09
I am looking for a program that will sort incoming email thru outlook. if subject = ' x' then save it to a text file in separate columns. one column for each: to, from , suject, message.
--->>>actually i wanted this on the server, but cant have a copy of outlook on the exchange..so my only solution is to have the exchange send to client..client sorts email...then if subject = 'x' then save to text, as I dont know if exchange can save to a text file.
here is what I have so far:
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim strname as stirng
strname = objItem.Subject
Set myItem = Application.ActiveInspector
If strname = "X" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs Environ("HOMEPATH") & "\My Documents\" & strname & ".txt", olTXT
MsgBox "There is no current active inspector."