Second go round on assigning categories with Macro



A week or so ago, I had asked a question on how to assign
categories to emails and I got a great answer based on what
I had asked. Since that time, I have found that I missed a
necessary requirment the appointment items I get that I
also need to categorize.

So to recap, I am looking for a way to assign categories to
emails (and appointment items) through a macro. I can
currently select several emails (and appointment items) 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.

What I got back then and am currently using is as follows:

Sub AssignDepartment()
'Assigns the selected email items to the DepartmentCategory

Dim oSel As Outlook.Selection
Dim oMail As Outlook.MailItem

Set oSel = Application.ActiveExplorer.Selection
For Each oMail In oSel
oMail.Categories = "Department"
End Sub

Is there a way to modify this to include Outlook.MailItem
as well as Outlook.AppointmentItem?





Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question