Apply a category to item in inbox view

D

DStrong

OK, here is what I am trying to do. I have used the flags to categorize
emails and set up some icons on a toolbar that I can click on and it applies
the flag color to the email while the email is in the inbox view, the place I
see the subject, from, received by on a line for each message in my inbox.
This has worked fine, but now I want to apply the same idea but I want to
apply a category to the email instead of a flag. I have used some code that
allows me to open the email and apply this category, but I want this macro to
apply the category with out the need of opening the email in a new window.

I tried this code:

dim objMail as outlook.mailitem
set objMail=application.activeinspector.selection(1)
with objMail
.categories = "category name"
.save
end with


what works when the email is open in it own window is this:

dim objMail as outlook.mailitem
set objMail=application.activeinspector.currentitem
with objMail
.categories = "category name"
.save
end with


Does anyone know of way to accomplish what I have listed here? Has anyone
ever done something similar?? Please help.
 
S

Sue Mosher [MVP]

The object browser (F2 in VBA). Use it to look up Selection, and you should
see that it's a property of ActiveExplorer, not ActiveInspector.
 

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

Top