nabend alle zu sammen,
hatte schon eine weile nix mehr mit Autoit gemacht. Nun muss ich etwas machen und komme nícht recht vorwärts. Hier mein Code aus dem Forum.
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=\Mail.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <INet.au3>
#include <date.au3>
;Hier kommt die Registry Abfrage nach dem Schlüssel den HeiWoMa entdeckt hat. Gibt es den Schlüssel nicht ($Outlookexist =""), dann ist auch kein ;Outlook auf dem System installiert.
$Outlookexist = RegRead("HKEY_CLASSES_ROOT\msgfile\shell\open\command", "command")
$file = "C:\ADTG\Datensicherung\test.zup"
;Hier sieht man das die Variabe leer zurückgekommen ist, also kein Outlook installiert.
;E-Mail wird über den Standard E-Mail client z.B.OE versendet.
$var = IniReadSection("H:\NAV\AMFA.ini", "HVP")
$vas = IniReadSection("H:\NAV\AMFA.ini", "Mail")
If FileExists("H:\NAV\Thomas\*.csv") Then
CreateMailItem()
EndIf
;
Func CreateMailItem()
Local $olMailItem = 0
Local $olFormatRichText = 2
Local $olImportanceNormal = 2
$oOApp = ObjCreate("Outlook.Application")
$oOMail = $oOApp.CreateItem($olMailItem)
With $oOMail
[/autoit] [autoit][/autoit] [autoit]For $y = 1 To $vas[0][0]
MsgBox(0,"","H:\NAV\Thomas\" & StringRight($var[$y][1], 7) & ".csv" & ' ' & $vas[$y][1],10)
.To = ($vas[$y][1])
.BCC = ("")
.Subject = "Vertriebspartner Report"
.Body = ":-)"
.BodyFormat = $olFormatRichText ;Diese Funktion geht ab Outlook 2003, auskommentiert für die Outlook 2000 Kompabilität
.Attachments.Add ("H:\NAV\Thomas\" & StringRight($var[$y][1], 7) & ".csv")
.Importance = $olImportanceNormal
.Display
;.Send ;Die Send Funktion ist wegen den Outlook Sicherheitsrichtlinien ausgeschaltet.
Sleep(500)
Send("!s")
Sleep(10000)
Next
EndWith
EndFunc ;==>CreateMailItem
[/autoit]Die abgefragte Ini besteht aus zweit Section. In der ersten steht der Dateianhang in der zweiten die Mailadressen. Meine Kontrollbox zeigt das mein Weg der richtige ist. Doch leider bekomme ich eine Fehlermeldung während des zweiten Durchlauf der Schleife.
Fehlermeldung:
D:\Programme\AutoIt3\Include\MAil_Outlook.au3 (31) : ==> The requested action with this object has failed.:
.To = ($vas[$y][1])
.To = ($vas[$y][1])^ ERROR
Hat wer ne Idee woran es liegt?
MFG ThomasB