If have a function that loops through a selection of emails, an email is an object not a lose variable (Passing variable from Form to Module in VBA):
Private Sub CommandButton5_Click()
For Each objItem In Application.ActiveExplorer.Selection
moveMail(TextBox1.Value, objItem)
Next
End Sub
based on - lets say - the subject I want to do something with that email. That means that I will have to move the mail object to a function. But if do like I did it now I get an error.
compiling error
synstaxt error