I'm trying to set the mail message categories for the current selection. When I run the macro I end up in only a single message being set to the given categorie. I Use the following code (and have also tried to use a do until..loop using the selection.count
):
Sub SetSelectionComplete()
Dim mailMsg As MailItem
For Each mailMsg In Outlook.Application.ActiveExplorer.Selection
mailMsg.Categories = "Complete"
Next
End Sub
Any ideas?
Save the mailMsg item each time, like this:
Sub SetSelectionComplete()
Dim mailMsg As MailItem
For Each mailMsg In Outlook.Application.ActiveExplorer.Selection
mailMsg.Categories = "Complete"
mailMsg.Save
Next
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With