Apply a category to item in inbox view

  • Thread starter RFN0cm9uZw
  • Start date Views 1,374
Status
Not open for further replies.
R

RFN0cm9uZw

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.

David
 
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.

Sue Mosher

"DStrong" <DStrong> wrote in message

news:3EB958D7-B3B4-4E7D-9932-2DF97A932149@microsoft.com...
> 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.
> > David
>
 
Status
Not open for further replies.
Top