A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Apply a category to item in inbox view



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 7th 09, 10:16 PM posted to microsoft.public.outlook.program_vba
DStrong
external usenet poster
 
Posts: 18
Default Apply a category to item in inbox view

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

Ads
  #2  
Old May 7th 09, 10:40 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Apply a category to item in inbox view

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, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DStrong" wrote in message
...
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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I Apply Two Filters to Task View? mtbcpa Outlook - General Queries 5 June 23rd 08 05:48 PM
apply a form to emails received in a team inbox console1 Outlook - Using Forms 1 September 8th 07 04:25 PM
How do I apply a custom view to all of my folders? ScottinSB Outlook - Installation 1 June 18th 07 04:05 AM
sort by category in the category view captaindarth Outlook - Using Contacts 2 February 16th 07 10:53 PM
Apply weekly view to daily view Rhys Davies Outlook - Calandaring 1 January 12th 06 09:45 AM


All times are GMT +1. The time now is 03:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.