i tried several approaches to perform a specifc search, but somehow I do not succeed. This is some pseudocode that (hopefully) explains what I am after:
Mail of interest = new received mail
Search term = communicationID of mail of interest
Mainfolder = inbox
Find all subfolders in Mainfolder
Targetfolder = FoundFolder 1
Find Searchterm in Targetfolder
If Searchterm was found then move mail of interest to Targetfolder and exit
If Serchterm was not found continue in next Foundfolder
If no further results exist leave mail of interest in inbox and exit.
I manage to fetch the "mail of interest" and I manage to move it once I identified a relevant folder, but I am struggling with the identification of the subfolders and to Loop through them.
The Intention is to "not search" in the inbox itself but only in the subfolders.
I am quite new to outlook VBA, so If anyone could help with a code snippet or with some explanation how to DIM which variables and how to construct the search for the Targetfolders and Looping through those Targetfolders one by one that would be great.
Thanks Ralf
PS: Talking about outlook 2013