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

Change the category of a mail item usinb VB



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 2nd 06, 02:32 PM posted to microsoft.public.outlook.program_vba
CGF
external usenet poster
 
Posts: 3
Default Change the category of a mail item usinb VB

Hello all,
I'm trying to change the Categories in VB, but for some reason it is not
working. My situation is this: In the Inbox folder, I select some mail
items and run the following code:

Sub DefineCategories(CategoryStr As String)
Dim ItemInt As Integer

For ItemInt = 1 To
Application.ActiveExplorer.Selection.Count
Application.ActiveExplorer.Selection(ItemInt).Cate gories =
CategoryStr
Application.ActiveExplorer.Selection(ItemInt).Save
Next ItemInt
End Sub

But with this code, nothing happens. Could anyone help me with this ?

*** Sent via Developersdex http://www.developersdex.com ***
Ads
  #2  
Old June 3rd 06, 08:10 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Change the category of a mail item usinb VB

Am Fri, 02 Jun 2006 06:32:49 -0700 schrieb CGF:

If that code is within Outlook then there seems to be no error. Are sure
it´s running at all? You could set a breakpoint (F9) into the For... line
e.g. and watch whether or not the execution stops there. Then go through it
step by step with F8 and see what happens.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hello all,
I'm trying to change the Categories in VB, but for some reason it is not
working. My situation is this: In the Inbox folder, I select some mail
items and run the following code:

Sub DefineCategories(CategoryStr As String)
Dim ItemInt As Integer

For ItemInt = 1 To
Application.ActiveExplorer.Selection.Count
Application.ActiveExplorer.Selection(ItemInt).Cate gories =
CategoryStr
Application.ActiveExplorer.Selection(ItemInt).Save
Next ItemInt
End Sub

But with this code, nothing happens. Could anyone help me with this ?

*** Sent via Developersdex http://www.developersdex.com ***

  #3  
Old June 5th 06, 06:27 PM posted to microsoft.public.outlook.program_vba
CGF
external usenet poster
 
Posts: 3
Default Change the category of a mail item usinb VB

Yes, I'm sure it is working. I have already tried to do as you mentioned
(set breakpoint then F8). I had this code running OK on Outlook 2000
once, but I was dummy not backing it up, but I remember the code was
sothing like I wrote in the beginning. Now I'm using Outlook 2003 and
want to have the same feature. Perhaps there is a difference between
2000 and 2003.

*** Sent via Developersdex http://www.developersdex.com ***
  #4  
Old June 6th 06, 05:33 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Change the category of a mail item usinb VB

Am Mon, 05 Jun 2006 10:27:19 -0700 schrieb CGF:

Weird, it really doesn´t work. But with a little modification it does:

Sub DefineCategories(CategoryStr As String)
Dim ItemInt As Integer
Dim obj As Object

For ItemInt = 1 To Application.ActiveExplorer.Selection.Count
Set obj = Application.ActiveExplorer.Selection(ItemInt)
obj.Categories = CategoryStr
obj.Save
Next ItemInt
End Sub

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Yes, I'm sure it is working. I have already tried to do as you mentioned
(set breakpoint then F8). I had this code running OK on Outlook 2000
once, but I was dummy not backing it up, but I remember the code was
sothing like I wrote in the beginning. Now I'm using Outlook 2003 and
want to have the same feature. Perhaps there is a difference between
2000 and 2003.

*** Sent via Developersdex http://www.developersdex.com ***

  #5  
Old June 14th 06, 01:30 PM posted to microsoft.public.outlook.program_vba
CGF
external usenet poster
 
Posts: 3
Default Change the category of a mail item usinb VB

Thanks Michael. Works OK.

*** Sent via Developersdex http://www.developersdex.com ***
 




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
How do you do a mail merge using a category? Maren Outlook - Using Contacts 14 November 25th 07 02:10 AM
change a category for appointment that is in a series Steve_pctchr Outlook - Calandaring 3 August 29th 07 01:46 AM
Rule to Forward Incoming Mail Fails when item is itself a replied-to or forwarded e-mail Steven Bookman Outlook - General Queries 3 April 6th 06 09:41 PM
How do I send a mail to all contacts of a certain category only? man_in_berne Outlook - Using Contacts 1 March 29th 06 12:08 PM
Change a contact category for about 40 contacts - Susan Outlook - Using Contacts 4 January 26th 06 01:52 PM


All times are GMT +1. The time now is 04:03 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.