1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub AM_close(Cancel As Boolean)
Dim objNSpace As NameSpace
Dim NewAM
Dim fldDestination As MAPIFolder
If StopEvent Then Cancel = True
Set objNSpace = Application.GetNamespace("MAPI")
If Split(AM.Parent.FullFolderPath, "\", , vbTextCompare)(3) = "Boîte de réception" Then
If AM.Subject <> "" And AM.Sent Then
Set fldDestination = objNSpace.PickFolder
If Not fldDestination Is Nothing Then
StopEvent = True
Set NewAM = AM.Move(fldDestination)
Cancel = True
NewAM.Display
StopEvent = False
End If
Else
Set AM = Nothing
End If
End If
End Sub |
Ci-dessus le code, en revanche il s'arrete sur le ligne
Set NewAM = AM.Move(fldDestination)
et me dis que je ne peux pas utiliser cette procédure dans cet événement.
Comment contourner ceci.
Partager