![]() |
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
|
|||
|
|||
![]()
Hi,
I have 4 existing macros which forward the selected email from the inbox to 1 of 4 pre-set email accounts when run. I would like to include code into these macros that marks the emails in the inbox with a category colour so i can see which items have been forwarded to which 1 of the 4 pre-set email accounts e.g. Blue Category, Red Category, Yellow Category and Green Category. I have played around with objMail.Categories and objMail.Save without any success. I hope somebody can assist. My existing Macro code is: Sub EmailFoward() Dim objMail As Outlook.MailItem Set objItem = GetCurrentItem() Set objMail = objItem.Forward objMail.To = "email account" objMail.Send Set objItem = Nothing Set objMail = Nothing End Sub Function GetCurrentItem() As Object Dim objApp As Outlook.Application Set objApp = Application On Error Resume Next Select Case TypeName(objApp.ActiveWindow) Case "Explorer" Set GetCurrentItem = _ objApp.ActiveExplorer.Selection.Item(1) Case "Inspector" Set GetCurrentItem = _ objApp.ActiveInspector.CurrentItem Case Else End Select End Function Thanks. (Running Outlook 2007). Last edited by CamP : October 25th 10 at 08:01 AM. |
Ads |
#2
|
|||
|
|||
![]()
Hi,
For those who might be interested I have solved my problem. I added a new category under Outlook called "test" and allocated it a colour. I also added this code into my existing Macro: Call MarkWithCategory("test") and Sub MarkWithCategory(strCat As String) Dim objItem As Object Set objItem = GetCurrentItem() If Not objItem Is Nothing Then objItem.Categories = objItem.Categories & "," & strCat objItem.Save End If Set objItem = Nothing End Sub Hope this assists somebody. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add the macro in new mail form | masani paresh[_2_] | Outlook - Using Forms | 1 | December 24th 08 03:22 PM |
How do I colour code emails from hotmail? | Joan Mary | Outlook - General Queries | 5 | June 28th 08 12:07 PM |
Colour code from different servers | Pete A | Outlook - General Queries | 3 | June 16th 07 03:06 PM |
Colour code outlook contacts | perthkat | Outlook - Using Contacts | 1 | April 26th 06 08:30 AM |
How do I colour-code meeting req. for shared users on a network? | Revelfree | Outlook - Calandaring | 0 | March 15th 06 11:16 AM |