Changing tabs color in active sheet with help VB Script

         Changing tabs color in active sheet can do app more user frendly. You can do it without using vb script, but it have some restriction. For example you should to know sheet name always. Using vb script have no that restriction.


    I offer you a piece of code:
        sub ChangeColorActive    
        'sets the value non active color of all sheets   
            for i=0 to ActiveDocument.NoOfSheets-1    
                set vSheet = ActiveDocument.GetSheet(i)    
                set vSheetProp = vSheet.GetProperties    
                vSheetProp.TabAttr.BgColor.PrimaryCol.Col = RGB(241,238,229)    
                vSheetProp.TabAttr.FgColor.PrimaryCol.Col = RGB(232,98,32)    
                vSheetProp.TabAttr.Mode = 2    
                vSheet.SetProperties vSheetProp    
        'Determine active sheet and sets the value active color
            set vSheet = ActiveDocument.ActiveSheet    
            set vSheetProp = vSheet.GetProperties    
            vSheetProp.TabAttr.BgColor.PrimaryCol.Col = RGB(67,117,115)    
            vSheetProp.TabAttr.FgColor.PrimaryCol.Col = RGB(250,245,120)    
            vSheetProp.TabAttr.Mode = 2    
            vSheet.SetProperties vSheetProp    
        End sub    


    That macro you should choose like trigger in every sheets your app in OnActivateSheet side.