Jeg har lavet følgende program, hvormed man kan flytte mails til en specifik mappe. Det virker fint, undtagen når mail'en har en digital signatur,-så virker det ikke.
Er der nogen, der kan hjælpe??
Function MoveEmail(mappath As String) As Boolean
Dim objArchiveFolder As Outlook.MAPIFolder
Dim objFolder As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim objItem As Outlook.MailItem
On Error Resume Next
FlytEmail = False
Set objNS = Application.GetNamespace("MAPI")
objNS.Logon
Set objArchiveFolder = mdlOutlook.FindMappe(objArchiveFolder, mappath)
If objArchiveFolder Is Nothing Then
GoTo SetToNothing
End If
If Application.ActiveExplorer.Selection.Count = 0 Then
GoTo SetToNothing
End If
For Each objItem In Application.ActiveExplorer.Selection
If objItem.Class = olMail Then
objItem.Move objArchiveFolder
MoveEmail = True
End If
Next
SetToNothing:
On Error Resume Next
objNS.Logoff
Set objItem = Nothing
Set objArchiveFolder = Nothing
Set objFolder = Nothing
Set objNS = Nothing
On Error GoTo 0
End Function