PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Assign Categories to Mail via Macro
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Assign Categories to Mail via Macro
![]() |
Assign Categories to Mail via Macro |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am looking for a way to assign categories to emails
through a macro. I can currently select several emails in my inbox, then right click and select categories, then select the category I want, but what I would like to do is create a macro which I can place in a toolbar. When I select items in my inbox, I would then go to the toolbar, and select the correct button to assign them to the appropriate category. Can this be done? Thanks, KdBrown |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Yes. For a macro you'd use Application.ActiveExplorer to get the
current folder. The Selection collection of that Explorer has all your selected items. So the body of the code would look something like this: Dim oSel As Outlook.Selection Dim oMail As Outlook.Mailitem Set oSel = Application.ActiveExplorer.Selection For Each oMail In oSel oMail.Categories = "my category" oMail.Save Next -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginners Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "KdBrown" <anonymous@discussions.microsoft.com> wrote in message news:121a901c3f57b$2ac238e0$a501280a@phx.gbl... > I am looking for a way to assign categories to emails > through a macro. I can currently select several emails in > my inbox, then right click and select categories, then > select the category I want, but what I would like to do is > create a macro which I can place in a toolbar. When I > select items in my inbox, I would then go to the toolbar, > and select the correct button to assign them to the > appropriate category. > > Can this be done? > > Thanks, > KdBrown |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Ken,
Thanks, that worked great. I had been searching high and low for two weeks for that. KdBrown >-----Original Message----- >Yes. For a macro you'd use Application.ActiveExplorer to get the >current folder. The Selection collection of that Explorer has all your >selected items. So the body of the code would look something like >this: > >Dim oSel As Outlook.Selection >Dim oMail As Outlook.Mailitem > >Set oSel = Application.ActiveExplorer.Selection >For Each oMail In oSel > oMail.Categories = "my category" > oMail.Save >Next > >-- >Ken Slovak >[MVP - Outlook] >http://www.slovaktech.com >Author: Absolute Beginners Guide to Microsoft Office Outlook 2003 >Reminder Manager, Extended Reminders, Attachment Options >http://www.slovaktech.com/products.htm > > >"KdBrown" <anonymous@discussions.microsoft.com> wrote in message >news:121a901c3f57b$2ac238e0$a501280a@phx.gbl... >> I am looking for a way to assign categories to emails >> through a macro. I can currently select several emails in >> my inbox, then right click and select categories, then >> select the category I want, but what I would like to do is >> create a macro which I can place in a toolbar. When I >> select items in my inbox, I would then go to the toolbar, >> and select the correct button to assign them to the >> appropriate category. >> >> Can this be done? >> >> Thanks, >> KdBrown > > >. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

