I've run into an issue where i'm writing a macro in Outlook 2013 that goes through an inbox and whenever it comes across duplicate subject lines it moves the 2 emails to a different folder.
These "duplicates" have slight differences within the subject line, difference being a "new" prefix and a "closed" prefix.
I have a general idea on how I can achieve this, but i'm sure there would be a much cleaner and more efficient way to do so as there are 50 different subject lines (without prefix included) .
Currently my thoughts is to have something similar to below:
for i = 1 to inbox.items.count
if inbox.items(i) = "new - example subject 1" then
for x = 1 to inbox.items.count
if inbox.items(x) = "closed - example subject 1" then
inbox.items(x).unread = false
inbox.items(x).move otherFolder
inbox.items(i).unread = false
inbox.items(i).move otherFolder
exit for
end if
next x
end if
if inbox.items(i) = "new - example subject 2" then
for x = 1 to inbox.items.count
if inbox.items(x) = "closed - example subject 2" then
inbox.items(x).unread = false
inbox.items(x).move otherFolder
inbox.items(i).unread = false
inbox.items(i).move otherFolder
exit for
end if
next x
end if
'repeating 50 times'
next i