I would like to store an email that I have just read (so, when I'm closing it) in a folder I select.
I have found and written something like this:
Private Sub myItem_close(Cancel As Boolean)
Dim F As Outlook.MAPIFolder
EventsDisable = True
If TypeOf myItem Is Outlook.mailitem Then
Set F = myItem.Parent
If F = Session.GetDefaultFolder(olFolderInbox) Then
Set F = Application.Session.PickFolder
myItem.Move F
End If
EventsDisable = False
End Sub
With this code, when I close an email, I'm asked to select a folder to store it, but code crashes at line myItem.Move F
saying that I can't use properties and methods in this event.