Ich würde gerne alle Anhänge alle Mails in einem Ordner löschen, leider gelingt mir das mit meinen AutoItscript nicht, der „Remove“ Befehl meldet einen COM-Fehler „unbekannter Name“. Hat jemand Erfahrungen, oder ein Idee?
[autoit]
#include <String.au3>
#include <date.au3>
#include <Array.au3>
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
Dim $oApp = ObjCreate("DVOBJAPILib.DvISEAPI")
Dim $oAcc = $oApp.Logon("", "", "", "", "", "NOAUTH")
Dim $oArchive = $oAcc.ArchiveFromID("\\dcsrv\david\archive\user\10038000\in\9")
Dim $oEntry = $oArchive.GetArchiveEntries("default")
Dim $oMessageItems = $oArchive.AllItems
Dim $oMailItem
For $i = 0 To $oMessageItems.Count - 1
If $oMessageItems.Item($i).Type = "2" Then
$oMailItem = $oMessageItems.Item($i)
If Not $oMailItem.Attachments.Count = 0 Then
$oAttachments = $oMailItem.Attachments
For $oAttachment In $oAttachments
ConsoleWrite("Description: " & $oAttachment.Description & @CRLF)
ConsoleWrite("Filename: " & $oAttachment.FileName & @CRLF)
ConsoleWrite("Displayname: " & $oAttachment.DisplayName & @CRLF)
ConsoleWrite("FileSize: " & $oAttachment.FileSize & @CRLF)
ConsoleWrite("FileTime: " & $oAttachment.FileTime & @CRLF)
ConsoleWrite("Type: " & $oAttachment.FileType & @CRLF)
$oAttachment.Description = "Eintrag geändert: "&@HOUR&@MIN&@SEC
$oAttachment.remove
$oMailItem.Save
Next
EndIf
EndIf
Next
Func MyErrFunc()
Local $sERR = _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & Hex($oMyError.number,
& @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext
MsgBox(0, "AutoItCOM Test", "Ein COM-Fehler ist aufgetreten !" & @CRLF & @CRLF & $sERR)
Local $err = $oMyError.number
If $err = 0 Then $err = -1
Local $g_eventerror = $err
EndFunc ;==>MyErrFunc