Sunday 15 June 2014

outlook vba - ms 2010 vb to move email to a different mailbox and subfolder -



outlook vba - ms 2010 vb to move email to a different mailbox and subfolder -

i looking move emails folder deleted folder of below mailbox. "compile error: variable not defined" message, have gone wrong?

sub movetofolder(foldername) mailboxnamestring = "mailbox - david beach" dim olapp new outlook.application dim olnamespace outlook.namespace dim olcurrexplorer outlook.explorer dim olcurrselection outlook.selection dim oldestfolder outlook.mapifolder dim olcurrmailitem mailitem dim m integer set olnamespace = olapp.getnamespace("mapi") set olcurrexplorer = olapp.activeexplorer set olcurrselection = olcurrexplorer.selection set oldestfolder = olnamespace.folders(mailboxnamestring).folders(foldername) m = 1 olcurrselection.count set olcurrmailitem = olcurrselection.item(m) debug.print "[" & date & " " & time & "] moving #" & m & _ ": folder = " & foldername & _ "; subject = " & olcurrmailitem.subject & "..." olcurrmailitem.move oldestfolder next m end sub sub delete() movetofolder ("deleted items") end sub

this line outlook 2003. mailboxnamestring = "mailbox - david beach"

take @ 2010 mailbox , utilize name.

outlook-vba

No comments:

Post a Comment