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

Programmatically assigning categories



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 12th 07, 05:56 PM posted to microsoft.public.outlook.program_vba
Jody
external usenet poster
 
Posts: 5
Default Programmatically assigning categories

Can you guys tell me how to implement this?

I have several categories and would like emails that are sent regarding
specific events:

Such as an email sent with the word "Netapp" to automatically be assinged
netapp upgrade category.

How can a programatically setup categories in this manner?

Please include step by step instructions as I am new to outlook programming
and don't know exactly how to edit the code but, have done similar things in
thep ast with previous verisons of outlook.

I appreciate the help.



"RobL" wrote:

Well Sue,

you're a genius! I really appreciate your help.

Cheers,
Rob
--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Yes. Unless you save the item, the changes are not permanent.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"RobL" wrote in message ...
Hi Sue,

I'm not doing a .Save anywhere in my code. Do you think that including one
after my category assignment would encourage the explorer to re-group by
category?

Mit freundlichen Grüßen
Rob

--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Maybe a dumb question, but are you also including an objMail.Save statement?

"RobL" wrote in message ...
Hello again,

a small update to my problem:

When I assign a Category programmatically (through objMail.Categories =
"MyCategory" as before), the explorer doesn't catch on to the fact that the
category has changed until I right-click and do Categories...

The category I assigned programmatically is there in the list and is ticked,
and it's only when I ok this dialog that the explorer finally re-organises
itself and the email is grouped by the correct category.

Is there a way to programmatically force this to happen?



"RobL" wrote:

Hi Guys,

Outlook 2003, VBA Code:
I'm programmatically assigning categories to email messages (e.g.
objMail.Categories = "My Category"). All very well, but when I have my
emails arranged by Category, the location of the email in the Explorer does
not always match up its Category. Is there a way to refresh the sort when a
category changes. This area of functionality seems a little "flakey".

Your help is greatly appreciated.

Rob Levy
--
Software Support Engineer
i2 Ltd.


Ads
  #2  
Old September 13th 07, 06:25 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Programmatically assigning categories



The event you're looking for is the ItemSend event. Please look into the VBA
help for a sample.

Depending on your needs, you might search for 'netapp' in the item's subject
or body property. For that use the Instr function, which returns a value 0
if the string is found.

Then add a specific category to the item's Categories property. before that,
check if it already contains a value. If so, then add the new value with a
leading semicolon - else you would overwrite the existing category.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 12 Sep 2007 09:56:03 -0700 schrieb Jody:

Can you guys tell me how to implement this?

I have several categories and would like emails that are sent regarding
specific events:

Such as an email sent with the word "Netapp" to automatically be assinged
netapp upgrade category.

How can a programatically setup categories in this manner?

Please include step by step instructions as I am new to outlook

programming
and don't know exactly how to edit the code but, have done similar things

in
thep ast with previous verisons of outlook.

I appreciate the help.



"RobL" wrote:

Well Sue,

you're a genius! I really appreciate your help.

Cheers,
Rob
--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Yes. Unless you save the item, the changes are not permanent.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"RobL" wrote in message

...
Hi Sue,

I'm not doing a .Save anywhere in my code. Do you think that

including one
after my category assignment would encourage the explorer to re-group

by
category?

Mit freundlichen Grüßen
Rob

--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Maybe a dumb question, but are you also including an objMail.Save

statement?

"RobL" wrote in message

...
Hello again,

a small update to my problem:

When I assign a Category programmatically (through

objMail.Categories =
"MyCategory" as before), the explorer doesn't catch on to the fact

that the
category has changed until I right-click and do Categories...

The category I assigned programmatically is there in the list and

is ticked,
and it's only when I ok this dialog that the explorer finally

re-organises
itself and the email is grouped by the correct category.

Is there a way to programmatically force this to happen?


"RobL" wrote:

Hi Guys,

Outlook 2003, VBA Code:
I'm programmatically assigning categories to email messages (e.g.
objMail.Categories = "My Category"). All very well, but when I

have my
emails arranged by Category, the location of the email in the

Explorer does
not always match up its Category. Is there a way to refresh the

sort when a
category changes. This area of functionality seems a little

"flakey".

Your help is greatly appreciated.

Rob Levy
--
Software Support Engineer
i2 Ltd.


  #3  
Old June 17th 08, 02:45 AM posted to microsoft.public.outlook.program_vba
keith
external usenet poster
 
Posts: 71
Default Programmatically assigning categories

Is there a place where one can see an example of how to process incoming
mail, and assigning categories based on email address? I've hit the limit on
rules in the wizard and the exchange server now hates me. I'm looking to
expand my options through using VBA. I'm a relative newbie, and need
something that provides examples.

thanks in advance for anything you can offer!

"Michael Bauer [MVP - Outlook]" wrote:



The event you're looking for is the ItemSend event. Please look into the VBA
help for a sample.

Depending on your needs, you might search for 'netapp' in the item's subject
or body property. For that use the Instr function, which returns a value 0
if the string is found.

Then add a specific category to the item's Categories property. before that,
check if it already contains a value. If so, then add the new value with a
leading semicolon - else you would overwrite the existing category.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 12 Sep 2007 09:56:03 -0700 schrieb Jody:

Can you guys tell me how to implement this?

I have several categories and would like emails that are sent regarding
specific events:

Such as an email sent with the word "Netapp" to automatically be assinged
netapp upgrade category.

How can a programatically setup categories in this manner?

Please include step by step instructions as I am new to outlook

programming
and don't know exactly how to edit the code but, have done similar things

in
thep ast with previous verisons of outlook.

I appreciate the help.



"RobL" wrote:

Well Sue,

you're a genius! I really appreciate your help.

Cheers,
Rob
--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Yes. Unless you save the item, the changes are not permanent.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"RobL" wrote in message

...
Hi Sue,

I'm not doing a .Save anywhere in my code. Do you think that

including one
after my category assignment would encourage the explorer to re-group

by
category?

Mit freundlichen Grüßen
Rob

--
Software Support Engineer
i2 Ltd.


"Sue Mosher [MVP-Outlook]" wrote:

Maybe a dumb question, but are you also including an objMail.Save

statement?

"RobL" wrote in message

...
Hello again,

a small update to my problem:

When I assign a Category programmatically (through

objMail.Categories =
"MyCategory" as before), the explorer doesn't catch on to the fact

that the
category has changed until I right-click and do Categories...

The category I assigned programmatically is there in the list and

is ticked,
and it's only when I ok this dialog that the explorer finally

re-organises
itself and the email is grouped by the correct category.

Is there a way to programmatically force this to happen?


"RobL" wrote:

Hi Guys,

Outlook 2003, VBA Code:
I'm programmatically assigning categories to email messages (e.g.
objMail.Categories = "My Category"). All very well, but when I

have my
emails arranged by Category, the location of the email in the

Explorer does
not always match up its Category. Is there a way to refresh the

sort when a
category changes. This area of functionality seems a little

"flakey".

Your help is greatly appreciated.

Rob Levy
--
Software Support Engineer
i2 Ltd.



 




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
Programming custom Categories into Master Categories List John E. Outlook - Using Forms 3 March 30th 09 11:06 AM
Outlook 2007 Categories are a combo of Categories & Labels in 2003 Scott Sherman Outlook - Calandaring 0 February 13th 07 04:23 AM
Tasks categories. Unable to modify another user's categories. Tommy Outlook - Installation 0 August 9th 06 04:43 PM
Organizing contacts in folder by categories - new categories missi Annie Best Outlook - Using Contacts 5 May 16th 06 03:26 PM
Assigning Categories to Emails Keith Brown Outlook and VBA 1 February 15th 06 02:42 PM


All times are GMT +1. The time now is 06:15 AM.


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.