Hallo,
ich möchte einen Fehler abfangen der auftritt, wenn ich auch nicht MailItems im Explorer markiere (Run time error 13 Datatype mismatch). Kann man in For Each objMailSel In objSelection eine Abfrage hinzufügen und warum wird das nicht selbstständig gecheckt?
Danke für die Hilfe
Grüße Simon
Public Sub GetSelectedMailItems()
Dim objFolder As MAPIFolder
Dim objMailSel As MailItem
Dim objSelection As Selection
Select Case Application.ActiveWindow.Class
Case olExplorer
Set objFolder = Application.ActiveExplorer.CurrentFolder
If objFolder.DefaultMessageClass = \“IPM.Note\“ Then
Set objSelection = Application.ActiveExplorer.Selection
Select Case objSelection.Count
Case 0
MsgBox \“Es sind keine Mails ausgewählt !\“
Case Else
For Each objMailSel In objSelection
Forward objMailSel
Next
End Select
Set objSelection = Nothing
Else
MsgBox \“Im Ordner \’\“ & objFolder.Name & _
\“\‘ sind keine Mails enthalten!\“
End If
Set objFolder = Nothing
…