i have used the following macro to move unimportant (i.e. non-work related) mail in my outlook inbox into a folder in personal folders. it has worked for a long time, but suddenly it gives a "type mismatch" error when trying to move the mailitem.
Expand|Select|Wrap|Line Numbers
- Sub UnimportantMail()
- Dim myTargetFolder As MAPIFolder
- Dim myCurrentItem As Outlook.MailItem
- Set myCurrentItem = Application.ActiveExplorer.Selection
- Set myTargetFolder = Outlook.GetNamespace("MAPI").Folders("Personal Folders").Folders("Unimportant stuff")
- myCurrentItem.UnRead = False
- myCurrentItem.Move (myTargetFolder)
- Set myCurrentItem = Nothing
- Set myTargetFolder = Nothing
- End Sub
thank you in advance for your help!