The code indeed is pretty unefficiently: MyDocs is called multiple times although it returns always the same value, and it loops at least twice, if not three times, through each items attachments.
Also, VBA doesn´t use the OR in the If statement efficiently, that is it checks each part even if...