outlook - vba delete email from sent folder -


i want delete email sent items folder after email forwarded rule.

i tried use "brettdj" code post:macro delete email it's not working me @ .

what i'm looking it's vba macro can delete email when run script rule.

any idea how can accomplished that

thanks in advance

you don't have corresponding entry in contacts folder (address book). add method of recipients class accepts name of recipient; can string representing display name, alias, or full smtp e-mail address of recipient.

sub forwardemail(itm outlook.mailitem)    dim oexplorer outlook.explorer    dim omail outlook.mailitem    dim ooldmail outlook.mailitem    set oexplorer = application.activeexplorer    if oexplorer.selection.item(1).class = olmail      set ooldmail = oexplorer.selection.item(1)      set omail = ooldmail.forward      omail.recipients.add "test@gmail.com"      omail.recipients.item(1).resolve      if omail.recipients.item(1).resolved        'delete forwarded email sent items         omail.deleteaftersubmit = true          omail.send         'delete original email inbox         'ooldmail.delete      else          msgbox "could not resolve " & omail.recipients.item(1).name      end if    else      msgbox "not mail item"    end if  end sub 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -