|Outlook Developer Reference|
Moves a Microsoft Outlook item to a new folder.
expression A variable that represents a MailItem object.
|DestFldr||Required||Folder||An expression that returns a Folder object. The destination folder.|
An Object value that represents the item which has been moved to the designated folder.
This Visual Basic for Applications (VBA) example uses GetDefaultFolder to return the Folder object that represents the default folder. It then uses the Find and FindNext methods to find all messages sent by Dan Wilson and uses the Move method to move all e-mail messages sent by Dan Wilson from the default Inbox folder to the Personal Mail folder. To run this example without any errors, replace 'Dan Wilson' with a vaid sender name and make sure there's a folder under Inbox called 'Personal Mail'. Note that
myItem is declared as type Object so that it can represent all types of Outlook items including meeting request and task request items.
|Visual Basic for Applications|