Thank you
Code: Select all
Attachments:
/*
Export all Attachments of a currently opened Outlook-Email to a folder
*/
!=::
export:
; ###### Exporting of Email in current Outlook-Inspector
oOutlook := ComObjActive("Outlook.Application")
oInspector := oOutlook.Application.ActiveInspector
Mail := oInspector.CurrentItem ; thats the current Emails Object
; Exporting Attachments
att_count:=mail.attachments.count
loop, %att_count%
{
att_filename:=mail.attachments(a_index).filename
FileGetSize, OutputVar, %att_filename%, K
MsgBox % OutputVar
storepathname:="C:\Users\" . A_Username . "\Documents\" att_filename
mail.attachments(a_index).saveasfile(storepathname)
FileGetSize, OutputVar, %storepathname%, K
MsgBox %storepathname% %OutputVar%
If ( OutputVar > "20" )
FileAppend, `n%att_filename%, C:\%Username%\Files\DoNotChange\TaskDescription.txt
Else
FileDelete, %storepathname%
}
;https://autohotkey.com/boards/viewtopic.php?t=9159 Jovannb
return