Set myDestFolder = myInbox.Folders("Personal Mail") Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) Set myNameSpace = Application.GetNamespace("MAPI") 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. 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'. It then uses the Find and FindNext methods to find all messages sent by Dan Wilson and uses the Move method to move all email messages sent by Dan Wilson from the default Inbox folder to the Personal Mail folder. This Visual Basic for Applications (VBA) example uses GetDefaultFolder to return the Folder object that represents the default folder. The destination folder.Īn Object value that represents the item which has been moved to the designated folder. Parameters NameĪn expression that returns a Folder object. SyntaxĮxpression A variable that represents a MailItem object. Moves a Microsoft Outlook item to a new folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |