![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |