Skip to main content

Download-Attachment

Command Description

Download the attachment in the specified mail message

Command Prototype

arrRet = Outlook.DownloadAttachments(message, savepath)

Parameter Description

ParameterRequiredTypeDefaultDescription
messageTrueexpression{}The mail object in the mailing list
savepathTruepath'''C:\Users'''Save path of the attachment

return

arrRet,The variable used to save the output of the command.

Demo

/***********************************Download attachments************ ************************************ 
**Entry 1
** message--message objects in the mailing list.
**Entry 1
** path--mail attachment save path
**Exit
** arrRet--return download result
*****************************************************************************************/
TracePrint "--------------------------------------------Get mailing list- ---------------------------------------------"
arrayRet = Outlook.GetMailMessages("lzz1712@outlook.com","Inbox","Test",False,True,0)
TracePrint "--------------------------------------------Download Attachment-- ---------------------------------------------------------"
arrRet = Outlook.DownloadAttachments(arrayRet[0], @res"")
TracePrint "Output whether the download of the attachment to arrayRet[0] is successful:"&CStr(arrRet)
TracePrint "----------------------------------------------------------------------------------------------------"