Sending email copy (*.msg file) of sent email if subject line contains specific string.

RawlinsCross

Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
Hi,

A newbie when it comes to Outlook VBA. Was looking to solve a problem. I wish to copy a sent email to a folder (*.msg file) when the subject line contains a specific string. How can this be done?

Cheers,

RC.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
well, you could do this using a rule... but an itemadd macro can watch the sent folder and move/copy messages - and will mark them as read (unlike rules). Sample code is here Mark Sent Items as Read After Copying with a Rule - to move based on a subject line if you aren't using a rule, you'd use and if statements -
if instr(1,lcase(item.subject),"the phrase in lower case") > 0 then
' do whatever
end if
 
Top