excel - If email subject line starts with certain values then do something -


what wrong line of code? throws run-time error '13', type mis-match.

dim mail outlook.mailitem  if mail.subject "veh" & "*" or "mat" & "*" 

trying if subject of email starts "veh" or "mat", something.

the correct syntax if statement is:

if (mail.subject "veh*") or (mail.subject "mat*")   

the brackets optional (like operator has higher precedence or), it's easier read.


Comments