• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Outlook reverse categories

alexsth

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#1
Hi,

I created a menu in VBA for managing my different categories. I often assign many categories for one single email and i would like to reverse the order that the categories are shown in the email.

For example:

I could set the following categories: Now-someone waiting-client-Estimate.

I will press the previous categories button in my userform but in the email, it will appear conversely: Estimate-client-someone waiting-Now.

Is there any way of reversing the way that the categories are shown?

Thanks,

Alex
 
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
#2
You could set all the categories at once:

Code:
Private Sub SetCategories()

Dim myItem As Object
Dim strCat As String

Set myItem = ActiveInspector.currentItem

If myItem.Class = olMail Then
    strCat = "Estimate, client, someone waiting, Now"
    myItem.Categories = strCat
    myItem.Save
End If

ExitRoutine:
    Set myItem = Nothing
   
End Sub
Or reverse the order like this:

Code:
Private Sub ReverseCategories()

Dim myItem As Object
Dim strCat As String
Dim strCatReverse As String
Dim myCats As Variant
Dim i As Long

Set myItem = ActiveInspector.currentItem

If myItem.Class = olMail Then
    strCat = myItem.Categories
    Debug.Print strCat
    myCats = Split(strCat, ",")
   
    For i = UBound(myCats) To LBound(myCats) Step -1
        strCatReverse = strCatReverse & myCats(i) & ", "
    Next
       
    myItem.Categories = strCatReverse
    myItem.Save
End If

ExitRoutine:
    Set myItem = Nothing

End Sub
 

Similar threads