Skip to main content

Move-Mail

Command Description

Move an email to a folder, and return true if succeeds, return false if fails

Command Prototype

bRet = Outlook.MoveMessage(account ,tfolder ,message )

Parameter Description

ParameterRequiredTypeDefaultDescription
accountTruestring""The email address from which to move an email. It must be the same as the email address bound to Outlook
tfolderTruestring""Specify the destination folder to move the email to, such as "Inbox", "Drafts", "Sent Mails", etc
messageTrueexpression{}The mail object in the mailing list

return

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

Demo

/************************************Move Mail************ ************************************ 
**Entry 1
** account--The email address of the email to be moved must be the same as the email address bound to Outlook.
**Entry 2
** tfolder--Specify the destination folder for mail moving, such as "Inbox", "Drafts", "Sent Mail" and other folders.
**Entry 3
** message--message objects in the mailing list.
**Exit
** bRet--The variable to which the output of the function call is saved.
*****************************************************************************************/
TracePrint "--------------------------------------------Get mailing list- ---------------------------------------------"
arrayRet = Outlook.GetMailMessages("lzz1712@outlook.com","Inbox","Test",False,True,0)
TracePrint "--------------------------------------------Mobile Mail-- ---------------------------------------------------------"
bRet = Outlook.MoveMessage("lzz1712@outlook.com" ,"Deleted message" ,arrayRet[0] )
TracePrint "Output whether the arrayRet[0] file was successfully moved to the Deleted Items folder:"&CStr(bRet)
TracePrint "----------------------------------------------------------------------------------------------------"